T
- public abstract class AbstractCursorInt<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 int variant. For particular cursors, this may be implemented more efficiently saving at least one loop over n.
This is identical to AbstractCursor
, except that default
implementations build on the abstract int instead of long variant here.
n
Constructor and Description |
---|
AbstractCursorInt(int n) |
Modifier and Type | Method and Description |
---|---|
abstract AbstractCursorInt<T> |
copy() |
abstract AbstractCursorInt<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.
|
long |
getLongPosition(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(long[] pos)
Write the current position into the passed array.
|
T |
next() |
void |
remove() |
String |
toString() |
numDimensions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEachRemaining, hasNext
getIntPosition, localize, localize, positionAsLongArray, positionAsPoint
localize, positionAsDoubleArray, positionAsRealPoint
numDimensions
public AbstractCursorInt(int n)
n
- number of dimensions in the Img
.public void jumpFwd(long steps)
steps
- public void localize(float[] pos)
RealLocalizable
localize
in interface RealLocalizable
pos
- receives current positionpublic void localize(double[] pos)
RealLocalizable
localize
in interface RealLocalizable
pos
- receives current positionpublic void localize(long[] pos)
Localizable
localize
in interface Localizable
pos
- receives current positionpublic float getFloatPosition(int d)
RealLocalizable
getFloatPosition
in interface Localizable
getFloatPosition
in interface RealLocalizable
d
- dimensionpublic double getDoublePosition(int d)
RealLocalizable
getDoublePosition
in interface Localizable
getDoublePosition
in interface RealLocalizable
d
- dimensionpublic long getLongPosition(int d)
Localizable
getLongPosition
in interface Localizable
d
- dimensionpublic abstract AbstractCursorInt<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 AbstractCursorInt<T> copyCursor()
copyCursor
in interface Cursor<T>
copyCursor
in interface RealCursor<T>
Copyright © 2015–2022 ImgLib2. All rights reserved.