public class LocalizingRealIntervalIterator extends AbstractRealInterval implements Iterator, RealLocalizable
RealInterval in flat order, that
is: with the first dimension varying most quickly and the last dimension
varying most slowly. This is useful for iterating an arbitrary real interval
in a defined order.| Modifier and Type | Field and Description |
|---|---|
protected double[] |
location |
protected double[] |
step |
max, minn| Constructor and Description |
|---|
LocalizingRealIntervalIterator(double[] min,
double[] max,
double[] step)
Iterates an
RealInterval with given min and max the
the provided step along each dimension. |
LocalizingRealIntervalIterator(RealInterval interval,
double[] step)
Iterates an
RealInterval with given min and max with
the provided step along each dimension. |
| Modifier and Type | Method and Description |
|---|---|
void |
fwd()
Move forward.
|
double |
getDoublePosition(int d)
Return the current position in a given dimension.
|
float |
getFloatPosition(int d)
Return the current position in a given dimension.
|
boolean |
hasNext()
Returns true if another step forward is possible.
|
void |
jumpFwd(long steps)
Move steps × forward.
|
void |
localize(double[] position)
Write the current position into the passed array.
|
void |
localize(float[] position)
Write the current position into the passed array.
|
void |
reset()
Reset the
Iterator, that is put it to where it would be if newly
created. |
String |
toString() |
realMax, realMax, realMax, realMin, realMin, realMinnumDimensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitlocalize, positionAsDoubleArray, positionAsRealPointnumDimensionsmaxAsDoubleArray, maxAsRealPoint, minAsDoubleArray, minAsRealPointpublic LocalizingRealIntervalIterator(RealInterval interval, double[] step)
RealInterval with given min and max with
the provided step along each dimension.interval - the real intervalstep - iteration steppublic LocalizingRealIntervalIterator(double[] min,
double[] max,
double[] step)
RealInterval with given min and max the
the provided step along each dimension.min - real interval minmax - real interval minstep - iteration stepspublic void reset()
IteratorIterator, that is put it to where it would be if newly
created.public boolean hasNext()
Iteratorpublic String toString()
toString in class AbstractRealIntervalpublic void localize(float[] position)
RealLocalizablelocalize in interface RealLocalizableposition - receives current position, length must be ≥ EuclideanSpace.numDimensions()public void localize(double[] position)
RealLocalizablelocalize in interface RealLocalizableposition - receives current position, length must be ≥ EuclideanSpace.numDimensions()public float getFloatPosition(int d)
RealLocalizablegetFloatPosition in interface RealLocalizabled - dimensionpublic double getDoublePosition(int d)
RealLocalizablegetDoublePosition in interface RealLocalizabled - dimensionpublic void jumpFwd(long steps)
IteratorHighly recommended to override this with a more efficient version.
Copyright © 2009–2024 ImgLib2. All rights reserved.