T - public abstract class AbstractCursor<T> extends AbstractEuclideanSpace implements Cursor<T>
Cursor. Java's Iterator
interface is implemented by mapping to abstract Iterator.fwd() and
Sampler.get().
For localization, default implementations are available that all build on the abstract long variant. For particular cursors, this may be implemented more efficiently saving at least one loop over n.
n| Constructor and Description |
|---|
AbstractCursor(int n) |
| Modifier and Type | Method and Description |
|---|---|
abstract AbstractCursor<T> |
copy() |
abstract AbstractCursor<T> |
copyCursor() |
double |
getDoublePosition(int d)
Return the current position in a given dimension.
|
float |
getFloatPosition(int d)
Return the current position in a given dimension.
|
int |
getIntPosition(int d)
Return the current position in a given dimension.
|
void |
jumpFwd(long steps)
Highly recommended to override this with a more efficient version.
|
void |
localize(double[] pos)
Write the current position into the passed array.
|
void |
localize(float[] pos)
Write the current position into the passed array.
|
void |
localize(int[] pos)
Write the current position into the passed array.
|
T |
next() |
void |
remove() |
String |
toString() |
numDimensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemaining, hasNextgetLongPosition, localize, localize, positionAsLongArray, positionAsPointlocalize, positionAsDoubleArray, positionAsRealPointnumDimensionspublic AbstractCursor(int n)
n - number of dimensions in the Img.public void jumpFwd(long steps)
steps - public void localize(float[] pos)
RealLocalizablelocalize in interface RealLocalizablepos - receives current positionpublic void localize(double[] pos)
RealLocalizablelocalize in interface RealLocalizablepos - receives current positionpublic void localize(int[] pos)
Localizablelocalize in interface Localizablepos - receives current positionpublic float getFloatPosition(int d)
RealLocalizablegetFloatPosition in interface LocalizablegetFloatPosition in interface RealLocalizabled - dimensionpublic double getDoublePosition(int d)
RealLocalizablegetDoublePosition in interface LocalizablegetDoublePosition in interface RealLocalizabled - dimensionpublic int getIntPosition(int d)
LocalizablegetIntPosition in interface Localizabled - dimensionpublic abstract AbstractCursor<T> copy()
copy in interface Sampler<T>Sampler in the same state accessing the same
values.
It does NOT copy T, just the state of the Sampler.
Otherwise use T.copy() if available.
Sampler.copy().get() == Sampler.get(), i.e. both hold the same
value, not necessarily the same instance (this is the case for an
ArrayCursor for example)public abstract AbstractCursor<T> copyCursor()
copyCursor in interface Cursor<T>copyCursor in interface RealCursor<T>Copyright © 2015–2022 ImgLib2. All rights reserved.