Package net.imglib2.stream
Class RealLocalizableSamplerWrapper<T>
- java.lang.Object
-
- net.imglib2.stream.RealLocalizableSamplerWrapper<T>
-
- Type Parameters:
T- pixel type
- All Implemented Interfaces:
java.util.Spliterator<RealLocalizableSampler<T>>,EuclideanSpace,RealLocalizable,RealLocalizableSampler<T>,Sampler<T>,Typed<T>
class RealLocalizableSamplerWrapper<T> extends java.lang.Object implements java.util.Spliterator<RealLocalizableSampler<T>>, RealLocalizableSampler<T>
WrapsRealLocalizableSpliteratorasSpliterator<RealLocalizableSampler<T>>.Concretely, it implements
RealLocalizableSampler, forwarding all methods to the wrappedRealLocalizableSpliterator. And passes itself as a proxy to theConsumerintryAdvance(java.util.function.Consumer<? super net.imglib2.RealLocalizableSampler<T>>)andforEachRemaining(java.util.function.Consumer<? super net.imglib2.RealLocalizableSampler<T>>).
-
-
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>>
-
-
Field Summary
Fields Modifier and Type Field Description private RealLocalizableSpliterator<T>delegate
-
Constructor Summary
Constructors Constructor Description RealLocalizableSamplerWrapper(RealLocalizableSpliterator<T> delegate)Wrap the givendelegateasSpliterator<RealLocalizableSampler<T>>.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcharacteristics()RealLocalizableSamplerWrapper<T>copy()longestimateSize()voidforEachRemaining(java.util.function.Consumer<? super RealLocalizableSampler<T>> action)Tget()Access the actual T instance providing access to a pixel, sub-pixel or integral region value theSamplerpoints at.doublegetDoublePosition(int d)Return the current position in a given dimension.floatgetFloatPosition(int d)Return the current position in a given dimension.TgetType()Get an instance ofT.voidlocalize(double[] position)Write the current position into the passed array.voidlocalize(float[] position)Write the current position into the passed array.voidlocalize(RealPositionable position)Write the current position into the passedPositionable.intnumDimensions()Gets the space's number of dimensions.booleantryAdvance(java.util.function.Consumer<? super RealLocalizableSampler<T>> action)java.util.Spliterator<RealLocalizableSampler<T>>trySplit()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.imglib2.RealLocalizable
positionAsDoubleArray, positionAsRealPoint
-
-
-
-
Field Detail
-
delegate
private final RealLocalizableSpliterator<T> delegate
-
-
Constructor Detail
-
RealLocalizableSamplerWrapper
RealLocalizableSamplerWrapper(RealLocalizableSpliterator<T> delegate)
Wrap the givendelegateasSpliterator<RealLocalizableSampler<T>>.- Parameters:
delegate- spliterator to wrap
-
-
Method Detail
-
get
public T get()
Description copied from interface:SamplerAccess the actual T instance providing access to a pixel, sub-pixel or integral region value theSamplerpoints at.
-
getType
public T getType()
Description copied from interface:TypedGet an instance ofT.It should not be assumed that the returned
Tinstance is an independent copy. In particular, repeated calls togetType()may return the same instance.
-
copy
public RealLocalizableSamplerWrapper<T> copy()
- Specified by:
copyin interfaceRealLocalizableSampler<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)
-
forEachRemaining
public void forEachRemaining(java.util.function.Consumer<? super RealLocalizableSampler<T>> action)
- Specified by:
forEachRemainingin interfacejava.util.Spliterator<T>
-
tryAdvance
public boolean tryAdvance(java.util.function.Consumer<? super RealLocalizableSampler<T>> action)
- Specified by:
tryAdvancein interfacejava.util.Spliterator<T>
-
trySplit
public java.util.Spliterator<RealLocalizableSampler<T>> trySplit()
- Specified by:
trySplitin interfacejava.util.Spliterator<T>
-
estimateSize
public long estimateSize()
- Specified by:
estimateSizein interfacejava.util.Spliterator<T>
-
characteristics
public int characteristics()
- Specified by:
characteristicsin interfacejava.util.Spliterator<T>
-
numDimensions
public int numDimensions()
Description copied from interface:EuclideanSpaceGets the space's number of dimensions.- Specified by:
numDimensionsin interfaceEuclideanSpace
-
localize
public void localize(float[] position)
Description copied from interface:RealLocalizableWrite the current position into the passed array.- Specified by:
localizein interfaceRealLocalizable- Parameters:
position- receives current position, length must be ≥EuclideanSpace.numDimensions()
-
localize
public void localize(double[] position)
Description copied from interface:RealLocalizableWrite the current position into the passed array.- Specified by:
localizein interfaceRealLocalizable- Parameters:
position- receives current position, length must be ≥EuclideanSpace.numDimensions()
-
localize
public void localize(RealPositionable position)
Description copied from interface:RealLocalizableWrite the current position into the passedPositionable. Note for developers: This default implementation forwards toRealPositionable.setPosition(RealLocalizable), so don't do the same there.- Specified by:
localizein interfaceRealLocalizable- Parameters:
position- receives current positionEuclideanSpace.numDimensions()must be ≥EuclideanSpace.numDimensions()
-
getFloatPosition
public float getFloatPosition(int d)
Description copied from interface:RealLocalizableReturn the current position in a given dimension.- Specified by:
getFloatPositionin interfaceRealLocalizable- Parameters:
d- dimension- Returns:
- dimension of current position
-
getDoublePosition
public double getDoublePosition(int d)
Description copied from interface:RealLocalizableReturn the current position in a given dimension.- Specified by:
getDoublePositionin interfaceRealLocalizable- Parameters:
d- dimension- Returns:
- dimension of current position
-
-