Interface RealCursor<T>
-
- All Superinterfaces:
EuclideanSpace,java.util.Iterator<T>,Iterator,RealLocalizable,Sampler<T>,Typed<T>
- All Known Subinterfaces:
Cursor<T>
- All Known Implementing Classes:
AbstractArrayCursor,AbstractArrayLocalizingCursor,AbstractConvertedCursor,AbstractConvertedRealCursor,AbstractCursor,AbstractCursorInt,AbstractLocalizingCursor,AbstractLocalizingCursorInt,AbstractLongListImg.LongListCursor,AbstractLongListImg.LongListLocalizingCursor,ArrayCursor,ArrayLocalizingCursor,ArrayLocalizingSubIntervalCursor,ArraySubIntervalCursor,BiConvertedCursor,BiConvertedRealCursor,CellCursor,CellLocalizingCursor,ConvertedCursor,ConvertedRealCursor,KDTree.KDTreeCursor,ListCursor,ListLocalizingCursor,NtreeCursor,PlanarCursor,PlanarCursor1D,PlanarCursor2D,PlanarLocalizingCursor,PlanarLocalizingCursor1D,PlanarLocalizingCursor2D,PlanarPlaneSubsetCursor,PlanarPlaneSubsetLocalizingCursor,PointSampleList.PointSampleListCursor,RandomAccessibleIntervalCursor,RealPointSampleList.RealPointSampleListCursor,SlicingCursor,WriteConvertedCursor,WriteConvertedRealCursor
public interface RealCursor<T> extends RealLocalizable, Sampler<T>, Iterator, java.util.Iterator<T>
A RealCursor iterates over a set of RealLocalizable elements, for example intensity values sampled at a finite set of arbitrary real positions.RealCursor is a combination of several interfaces to achieve this. The
Iteratorinterface is used to iterate the set. UseIterator.fwd()to advance the cursor andIterator.hasNext()to check whether there are more elements. Note, that the Cursor starts before the first element, i.e., you have to callfwd()once to move to the first element.The
RealLocalizableinterface provides access to the position of the current element. TheSampler.get()method of theSamplerinterface provides access to the value of the current element.For convenience, Cursor also extends the
Iteratorinterface so that you are able to use Cursors in for-each loops. Calling theIterator.next()method is equivalent to callingfwd()andget(). That is, afternext()the Cursor is on the element returned bynext().get()can be used to obtain that element (again), andgetPosition()to obtain its position. TheIterator.remove()method is not supported by imglib Cursors, in general.It is not guaranteed that a RealCursor will perform bounds checking. Asking the position or value of a RealCursor that was not advanced to its first element, or was moved beyond its last element, has undefined results.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description RealCursor<T>copy()default RealCursor<T>copyCursor()Deprecated.Usecopy()insteaddefault Tnext()Default implementation, callsIterator.fwd()thenSampler.get().-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.RealLocalizable
getDoublePosition, getFloatPosition, localize, localize, localize, positionAsDoubleArray, positionAsRealPoint
-
-
-
-
Method Detail
-
copyCursor
@Deprecated default RealCursor<T> copyCursor()
Deprecated.Usecopy()instead
-
copy
RealCursor<T> copy()
- 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)
-
next
default T next()
Default implementation, callsIterator.fwd()thenSampler.get().Note, that
hasNext()is not checked beforefwd(). If such a check is desired it should be implemented infwd()(throwingNoSuchElementException).- Specified by:
nextin interfacejava.util.Iterator<T>
-
-