Interface LocalizableSpliterator<T>
- Type Parameters:
T- pixel type
- All Superinterfaces:
EuclideanSpace, Localizable, RealLocalizable, RealLocalizableSpliterator<T>, Sampler<T>, Spliterator<T>, Typed<T>
- All Known Implementing Classes:
ArrayLocalizingSpliterator, ArraySpliterator, CellSpliterator, CursorSpliterator, PlanarSpliterator
A
Spliterator<T> which is Localizable similar to a Cursor.
The location of the Spliterator reflects the location of the element passed
to the Consumer in Spliterator.tryAdvance(Consumer) or Spliterator.forEachRemaining(Consumer)
(at the time the element is passed, and until the next element is passed).
Similar to Cursor, LocalizableSpliterator usually
comes in two flavors:
IterableInterval.spliterator()computes location only on demand, andIterableInterval.localizingSpliterator()preemptively tracks location on every step.
To make the Localizable property available in a Stream, use
the Streams utility class to create
Stream<LocalizableSampler<T>> (which internally wraps
LocalizableSpliterator).
Corresponding to the LocalizableSpliterator flavors,
Streams.localizable(IterableInterval)computes element location only on demand, andStreams.localizing(IterableInterval)tracks location on every step.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR> -
Field Summary
Fields inherited from interface Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Method Summary
Methods inherited from interface EuclideanSpace
numDimensionsMethods inherited from interface Localizable
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localize, positionAsLongArray, positionAsPointMethods inherited from interface RealLocalizable
localize, localize, positionAsDoubleArray, positionAsRealPointMethods inherited from interface Spliterator
characteristics, estimateSize, forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics, tryAdvance
-
Method Details
-
trySplit
LocalizableSpliterator<T> trySplit()- Specified by:
trySplitin interfaceRealLocalizableSpliterator<T>- Specified by:
trySplitin interfaceSpliterator<T>
-
copy
LocalizableSpliterator<T> copy()- Specified by:
copyin interfaceRealLocalizableSpliterator<T>- Specified by:
copyin interfaceSampler<T>- Returns:
- - A new
Samplerin the same state accessing the same values. It does NOT copy T, just the state of theSampler. 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 anArrayCursorfor example)
-