public class ConstrainedStrideLocationIterator extends java.lang.Object implements DataLocationIterator
ConstrainedStrideLocationIterator
class iterates
over data locations using a constant step stride vector, but uses a
java.awt.Shape
object to determine if each location is
contained within a shape boundary. See DataLocation.increment(int[],int[])
for
details on how the locations are incremented with a stride.Constructor and Description |
---|
ConstrainedStrideLocationIterator(java.awt.Shape shape,
int[] stride)
Creates a new constrained 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 ConstrainedStrideLocationIterator(java.awt.Shape shape, int[] stride)
shape
- the shape to use for constraining the iterator
data locations.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.