|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object peersim.util.LinearIterator
public class LinearIterator
This class gives the linear order 0,1,etc or alternatively k-1, k-2, etc., depending on the constructor.
Constructor Summary | |
---|---|
LinearIterator()
Construct an iterator for an empty set of numbers. |
|
LinearIterator(boolean rev)
Construct an interator for an empty set of numbers. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if IndexIterator.next() can be called at least one more time. |
int |
next()
Returns next index. |
void |
reset(int k)
This resets the iteration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LinearIterator()
reset(int)
to actually fully initialize the object.
The numbers returned by consecutive calls to next()
are 0,1,...
public LinearIterator(boolean rev)
reset(int)
to actually fully initialize the object.
If parameter is true then the numbers returned by consecutive calls to
next()
are k-1,k-2,..., otherwise 0,1,...
Method Detail |
---|
public void reset(int k)
IndexIterator
reset
in interface IndexIterator
public int next()
next
in interface IndexIterator
public boolean hasNext()
IndexIterator
IndexIterator.next()
can be called at least one more time.
Note that IndexIterator.next()
can be called k times after IndexIterator.reset(int)
.
hasNext
in interface IndexIterator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |