|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NumberSeq<N extends java.lang.Number>
Experimental!. Iterates over numbers. The advantage over iterator is the ability to restart and to return the current item in the iteration more than once.
Common idiom for sequence iteration:for (seq.init(); seq.next();) { System.out.println("Number: " + seq.number()); }
Method Summary | |
---|---|
java.lang.String |
asString()
|
void |
init()
Initializes the iteration. |
N |
item()
Returns the current number in the sequence. |
boolean |
iter()
Tries to make the iteration and returns false if it could not
be done because the sequence has reached the end. |
java.util.Iterator<N> |
iterator()
Returns number iterator. |
N |
level()
|
N |
next()
|
Method Detail |
---|
void init()
iter()
is called for the first time.
boolean iter()
false
if it could not
be done because the sequence has reached the end. Otherwise on successful
iteration returns true
.
true
if the iteration has been successful or
false
otherwise.N item()
N level()
N next()
java.util.Iterator<N> iterator()
iterator
in interface java.lang.Iterable<N extends java.lang.Number>
java.lang.String asString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |