Package net.imglib2.converter.read
Class BiConvertedCursor<A,B,C>
- java.lang.Object
-
- net.imglib2.converter.AbstractConvertedCursor<A,C>
-
- net.imglib2.converter.read.BiConvertedCursor<A,B,C>
-
- All Implemented Interfaces:
java.util.Iterator<C>,Cursor<C>,EuclideanSpace,Iterator,Localizable,RealCursor<C>,RealLocalizable,Sampler<C>,Typed<C>
public class BiConvertedCursor<A,B,C> extends AbstractConvertedCursor<A,C>
TODO
-
-
Field Summary
Fields Modifier and Type Field Description protected Cconvertedprotected java.util.function.Supplier<? extends C>convertedSupplierprotected BiConverter<? super A,? super B,? super C>converterprotected java.util.function.Supplier<BiConverter<? super A,? super B,? super C>>converterSupplierprotected Cursor<B>sourceB-
Fields inherited from class net.imglib2.converter.AbstractConvertedCursor
source
-
-
Constructor Summary
Constructors Constructor Description BiConvertedCursor(Cursor<A> sourceA, Cursor<B> sourceB, java.util.function.Supplier<BiConverter<? super A,? super B,? super C>> converterSupplier, java.util.function.Supplier<? extends C> convertedSupplier)Creates a copy of c for conversion that can be accessed throughget().BiConvertedCursor(Cursor<A> sourceA, Cursor<B> sourceB, BiConverter<? super A,? super B,? super C> converter, java.util.function.Supplier<? extends C> convertedSupplier)Creates a copy of c for conversion that can be accessed throughget().
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BiConvertedCursor<A,B,C>copy()voidfwd()Move forward.Cget()Access the actual T instance providing access to a pixel, sub-pixel or integral region value theSamplerpoints at.CgetType()Get an instance ofT.booleanhasNext()The correct logic would be toreturn sourceA.hasNext() && sourceB.hasNext()but we test only sourceA for efficiency.voidjumpFwd(long steps)Move steps × forward.voidremove()voidreset()Reset theIterator, that is put it to where it would be if newly created.-
Methods inherited from class net.imglib2.converter.AbstractConvertedCursor
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localize, numDimensions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.imglib2.Cursor
copyCursor
-
Methods inherited from interface net.imglib2.Localizable
localize, localize, positionAsLongArray, positionAsPoint
-
Methods inherited from interface net.imglib2.RealCursor
next
-
Methods inherited from interface net.imglib2.RealLocalizable
positionAsDoubleArray, positionAsRealPoint
-
-
-
-
Field Detail
-
converterSupplier
protected final java.util.function.Supplier<BiConverter<? super A,? super B,? super C>> converterSupplier
-
converter
protected final BiConverter<? super A,? super B,? super C> converter
-
convertedSupplier
protected final java.util.function.Supplier<? extends C> convertedSupplier
-
converted
protected final C converted
-
-
Constructor Detail
-
BiConvertedCursor
public BiConvertedCursor(Cursor<A> sourceA, Cursor<B> sourceB, java.util.function.Supplier<BiConverter<? super A,? super B,? super C>> converterSupplier, java.util.function.Supplier<? extends C> convertedSupplier)
Creates a copy of c for conversion that can be accessed throughget().
-
-
Method Detail
-
get
public C 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 C 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.- Returns:
- an instance of
T
-
jumpFwd
public void jumpFwd(long steps)
Description copied from interface:IteratorMove steps × forward.Highly recommended to override this with a more efficient version.
-
fwd
public void fwd()
Description copied from interface:IteratorMove forward.
-
reset
public void reset()
Description copied from interface:IteratorReset theIterator, that is put it to where it would be if newly created.
-
hasNext
public boolean hasNext()
The correct logic would be toreturn sourceA.hasNext() && sourceB.hasNext()but we test only sourceA for efficiency. Make sure that sourceA is the smallerIterableInterval.
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<A>- Overrides:
removein classAbstractConvertedCursor<A,C>
-
copy
public BiConvertedCursor<A,B,C> copy()
- Specified by:
copyin interfaceCursor<A>- Specified by:
copyin interfaceRealCursor<A>- Specified by:
copyin interfaceSampler<A>- Specified by:
copyin classAbstractConvertedCursor<A,C>- 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)
-
-