public class StrideLocationIterator extends java.lang.Object implements DataLocationIterator
StrideLocationIterator
class iterates over data
locations using a constant step stride vector. See DataLocation.increment(int[],int[])
for
details on how the locations are incremented with a stride.Constructor and Description |
---|
StrideLocationIterator(DataLocation start,
DataLocation end,
int[] stride)
Creates a new stride location iterator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
static void |
main(java.lang.String[] argv)
Tests this class.
|
DataLocation |
next() |
DataLocation |
nextLocation(DataLocation loc)
Gets the next data location.
|
void |
remove() |
void |
reset()
Resets the iterator to the first element.
|
public StrideLocationIterator(DataLocation start, DataLocation end, int[] stride)
start
- the starting data location.end
- the ending data location.stride
- the data location stride in each dimension.public boolean hasNext()
hasNext
in interface java.util.Iterator<DataLocation>
public DataLocation nextLocation(DataLocation loc)
DataLocationIterator
nextLocation
in interface DataLocationIterator
loc
- the location to fill in with coordinates, or null to
allocate a new location.public void remove()
remove
in interface java.util.Iterator<DataLocation>
public void reset()
ResettableIterator
reset
in interface ResettableIterator
public DataLocation next()
next
in interface java.util.Iterator<DataLocation>
public static void main(java.lang.String[] argv)
argv
- the array of command line parameters.