T - the type of elements returned by this Spliterator, and the pixel type of the underlying cursor.public class RealCursorSpliterator<T> extends Object implements RealLocalizableSpliterator<T>
RealCursor.Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS,T_SPLITR extends Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED| Constructor and Description |
|---|
RealCursorSpliterator(RealCursor<T> cursor,
long origin,
long fence,
int additionalCharacteristics)
Creates a spliterator covering the given range.
|
| Modifier and Type | Method and Description |
|---|---|
int |
characteristics() |
RealCursorSpliterator<T> |
copy() |
long |
estimateSize() |
T |
get()
Access the actual T instance providing access to a pixel,
sub-pixel or integral region value the
Sampler points at. |
double |
getDoublePosition(int d)
Return the current position in a given dimension.
|
float |
getFloatPosition(int d)
Return the current position in a given dimension.
|
T |
getType()
Get an instance of
T. |
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 |
localize(RealPositionable position)
Write the current position into the passed
Positionable. |
int |
numDimensions()
Gets the space's number of dimensions.
|
double[] |
positionAsDoubleArray()
Allocate and return a double array with the position.
|
RealPoint |
positionAsRealPoint()
Allocate and return a
RealPoint with the current position. |
boolean |
tryAdvance(Consumer<? super T> action) |
RealCursorSpliterator<T> |
trySplit() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristicspublic RealCursorSpliterator(RealCursor<T> cursor, long origin, long fence, int additionalCharacteristics)
cursor - provides elements, starting with the element at origin, on cursor.next()origin - the least index (inclusive) to coverfence - one past the greatest index to coveradditionalCharacteristics - additional characteristics besides SIZED | SUBSIZEDpublic boolean tryAdvance(Consumer<? super T> action)
tryAdvance in interface Spliterator<T>public RealCursorSpliterator<T> trySplit()
trySplit in interface Spliterator<T>trySplit in interface RealLocalizableSpliterator<T>public long estimateSize()
estimateSize in interface Spliterator<T>public int characteristics()
characteristics in interface Spliterator<T>public T get()
SamplerSampler points at.public T getType()
TypedT.
It should not be assumed that the returned T instance is an
independent copy. In particular, repeated calls to getType() may
return the same instance.
public RealCursorSpliterator<T> copy()
copy in interface Sampler<T>copy in interface RealLocalizableSpliterator<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 int numDimensions()
EuclideanSpacenumDimensions in interface EuclideanSpacepublic 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 void localize(RealPositionable position)
RealLocalizablePositionable.
Note for developers: This default implementation forwards to
RealPositionable.setPosition(RealLocalizable), so don't do the
same there.localize in interface RealLocalizableposition - receives current position
EuclideanSpace.numDimensions() must be ≥
EuclideanSpace.numDimensions()public double[] positionAsDoubleArray()
RealLocalizableRealLocalizable.localize(double[]).positionAsDoubleArray in interface RealLocalizablepublic RealPoint positionAsRealPoint()
RealLocalizableRealPoint with the current position.
Please note that his method allocates a new RealPoint each time
which introduces notable overhead in both compute and memory.
If you query it frequently, you should allocate a dedicated
RealPoint first and reuse it with
RealLocalizable.localize(RealPositionable).positionAsRealPoint in interface RealLocalizablepublic float getFloatPosition(int d)
RealLocalizablegetFloatPosition in interface RealLocalizabled - dimensionpublic double getDoublePosition(int d)
RealLocalizablegetDoublePosition in interface RealLocalizabled - dimensionCopyright © 2009–2025 ImgLib2. All rights reserved.