Java iterators for C++:
|
Test ==> class iterJava<>. More...
#include "iterJava.h"
#include "str2list.h"
#include "BUnit.h"
#include <cassert>
#include "Tree_BF.h"
#include "Tree_LRP.h"
#include "Tree_LPR.h"
#include "Tree_PLR.h"
#include <cmath>
#include <iostream>
Go to the source code of this file.
Classes | |
class | test_iterJava |
Test ==> iterJava<> . More... | |
class | Random |
C++ encapsulation of a generator as a Java iterator. More... | |
Macros | |
#define | dim(V) ( sizeof(V)/sizeof(*V) ) |
#define | const_error |
Functions | |
std::list< long > | makeList_long (const char *V) |
void | const_compile_error (std::list< long > &L) |
Implementation to show that const_iterator cannot be used to erase values. More... | |
template<typename C > | |
bool | isPalindrome (const C &CCC) |
Returns true when CCC is a palindrome. More... | |
bool | palindromo (const std::list< std::string > &L) |
Regresa true si al recorrer el contenedor "L" hacia adelante se obtiene el mismo resultado que al recorrerlo hacia atrás. More... | |
void | make_a_o (TL::Tree< char > &T) |
T = ( a ( b ( f g h ) c d e ( i j ( l m ( n o ) ) k ) ) . More... | |
void | make_0_6 (TL::Tree< char > &T) |
T = ( 0 ( 1 ( 3 4 ) 2 ( 5 6 ) ) ) . More... | |
void | make_A_H (TL::Tree< char > &T) |
T = ( F ( B ( A ( C E ) D ) ) G ( I ( H ) ) ) . More... | |
void | make_A_O (TL::Tree< char > &T) |
T = ( A ( B ( D ( H I) E ( J K ) ) C ( F ( L M ) G ( N O ) ) ) ) . More... | |
void | generateRandom () |
Example usage of Java iterators as generators. More... | |
template<class Collection > | |
void | useIterator (Collection &C) |
Example usage of the iterJava<> iterator class. More... | |
int | main () |
Test ==> main() ==> iterJava() . More... | |
Test ==> class iterJava<>.
Definition in file test_iterJava.cpp.
#define dim | ( | V | ) | ( sizeof(V)/sizeof(*V) ) |
#define const_error |
std::list<long> makeList_long | ( | const char * | V | ) |
void const_compile_error | ( | std::list< long > & | L | ) |
Implementation to show that const_iterator cannot be used to erase values.
Definition at line 178 of file test_iterJava.cpp.
isPalindrome | ( | const C & | CCC | ) |
Returns true
when CCC
is a palindrome.
Definition at line 257 of file test_iterJava.cpp.
bool palindromo | ( | const std::list< std::string > & | L | ) |
Regresa true si al recorrer el contenedor "L" hacia adelante se obtiene el mismo resultado que al recorrerlo hacia atrás.
Un palíndromo es una palabra que se lee igual al derecho que al revés.
Definition at line 351 of file test_iterJava.cpp.
void make_a_o | ( | TL::Tree< char > & | T | ) |
T = ( a ( b ( f g h ) c d e ( i j ( l m ( n o ) ) k ) )
.
Definition at line 870 of file test_iterJava.cpp.
void make_0_6 | ( | TL::Tree< char > & | T | ) |
T = ( 0 ( 1 ( 3 4 ) 2 ( 5 6 ) ) )
.
Definition at line 919 of file test_iterJava.cpp.
void make_A_H | ( | TL::Tree< char > & | T | ) |
T = ( F ( B ( A ( C E ) D ) ) G ( I ( H ) ) )
.
+–H
Definition at line 955 of file test_iterJava.cpp.
void make_A_O | ( | TL::Tree< char > & | T | ) |
T = ( A ( B ( D ( H I) E ( J K ) ) C ( F ( L M ) G ( N O ) ) ) )
.
+–G |–N +–O
Definition at line 1003 of file test_iterJava.cpp.
void generateRandom | ( | ) |
Example usage of Java iterators as generators.
Definition at line 1075 of file test_iterJava.cpp.
void useIterator | ( | Collection & | C | ) |
Example usage of the iterJava<>
iterator class.
Definition at line 1089 of file test_iterJava.cpp.
int main | ( | ) |
Test ==> main()
==> iterJava()
.
Definition at line 1106 of file test_iterJava.cpp.