IndexIterator
, IndexIteratorSizable
, java.io.Serializable
public class IndexIteratorRectangular extends java.lang.Object implements IndexIterator, IndexIteratorSizable, java.io.Serializable
Constructor | Description |
---|---|
IndexIteratorRectangular(int D) |
Constructs iterator that returns int arrays of length D.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getD() |
Returns the length of the integer array that is returned as an iterate.
|
boolean |
hasNext() |
Indicates whether all iterates have been returned since last call to reset().
|
static void |
main(java.lang.String[] args) |
main method to test and demonstrate class.
|
int[] |
next() |
Returns the next iterate, or null if hasNext is false.
|
void |
reset() |
Puts iterator in a condition to begin iteration.
|
void |
setSize(int size) |
Sets range of all indexes to the given value
Indices returned vary from 0 to size-1
|
void |
setSize(int[] size) |
Sets the individual ranges for the elements of the returned
array.
|
public IndexIteratorRectangular(int D)
public void reset()
reset
in interface IndexIterator
public boolean hasNext()
hasNext
in interface IndexIterator
public int[] next()
next
in interface IndexIterator
public void setSize(int size)
public void setSize(int[] size)
setSize
in interface IndexIteratorSizable
public int getD()
getD
in interface IndexIterator
public static void main(java.lang.String[] args)