Package net.imglib2.stream
Interface LocalizableSpliterator<T>
-
- Type Parameters:
T- pixel type
- All Superinterfaces:
EuclideanSpace,Localizable,RealLocalizable,RealLocalizableSpliterator<T>,Sampler<T>,java.util.Spliterator<T>,Typed<T>
- All Known Implementing Classes:
ArrayLocalizingSpliterator,ArraySpliterator,CellSpliterator,CursorSpliterator,PlanarSpliterator
public interface LocalizableSpliterator<T> extends RealLocalizableSpliterator<T>, Localizable
ASpliterator<T>which is Localizable similar to a Cursor.The location of the Spliterator reflects the location of the element passed to the
ConsumerinSpliterator.tryAdvance(java.util.function.Consumer<? super T>)orSpliterator.forEachRemaining(java.util.function.Consumer<? super T>)(at the time the element is passed, and until the next element is passed).Similar to
Cursor,LocalizableSpliteratorusually comes in two flavors:IterableInterval.spliterator()computes location only on demand, andIterableInterval.localizingSpliterator()preemptively tracks location on every step.
To make the
Localizableproperty available in aStream, use theStreamsutility class to createStream<LocalizableSampler<T>>(which internally wrapsLocalizableSpliterator).Corresponding to the
LocalizableSpliteratorflavors,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 java.util.Spliterator
java.util.Spliterator.OfDouble, java.util.Spliterator.OfInt, java.util.Spliterator.OfLong, java.util.Spliterator.OfPrimitive<T extends java.lang.Object,T_CONS extends java.lang.Object,T_SPLITR extends java.util.Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocalizableSpliterator<T>copy()LocalizableSpliterator<T>trySplit()-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.Localizable
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localize, positionAsLongArray, positionAsPoint
-
Methods inherited from interface net.imglib2.RealLocalizable
localize, localize, positionAsDoubleArray, positionAsRealPoint
-
-
-
-
Method Detail
-
trySplit
LocalizableSpliterator<T> trySplit()
- Specified by:
trySplitin interfaceRealLocalizableSpliterator<T>- Specified by:
trySplitin interfacejava.util.Spliterator<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)
-
-