Package net.imglib2.img.array
Class AbstractArrayCursor<T extends NativeType<T>>
- java.lang.Object
-
- net.imglib2.AbstractEuclideanSpace
-
- net.imglib2.AbstractCursorInt<T>
-
- net.imglib2.img.array.AbstractArrayCursor<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
java.util.Iterator<T>
,Cursor<T>
,EuclideanSpace
,Iterator
,Localizable
,RealCursor<T>
,RealLocalizable
,Sampler<T>
- Direct Known Subclasses:
ArrayCursor
,ArraySubIntervalCursor
public abstract class AbstractArrayCursor<T extends NativeType<T>> extends AbstractCursorInt<T>
- Author:
- Stephan Preibisch, Stephan Saalfeld, Christian Dietz, Tobias Pietzsch
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayImg<T,?>
img
Source imageprotected int
lastIndex
Last indexprotected int
offset
Offset of this cursorprotected int
size
Size of this cursorprotected T
type
An instance of T-
Fields inherited from class net.imglib2.AbstractEuclideanSpace
n
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractArrayCursor(AbstractArrayCursor<T> cursor)
TODO JavadocAbstractArrayCursor(ArrayImg<T,?> img, int offset, int size)
TODO Javadoc
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fwd()
Move forward.T
get()
Access the actual T instance providing access to a pixel, sub-pixel or integral region value theSampler
points at.int
getIntPosition(int dim)
Return the current position in a given dimension.boolean
hasNext()
Returns true if another step forward is possible.void
jumpFwd(long steps)
Highly recommended to override this with a more efficient version.void
localize(int[] position)
Write the current position into the passed array.void
reset()
Reset theIterator
, that is put it to where it would be if newly created.java.lang.String
toString()
-
Methods inherited from class net.imglib2.AbstractCursorInt
copy, copyCursor, getDoublePosition, getFloatPosition, getLongPosition, localize, localize, localize, next, remove
-
Methods inherited from class net.imglib2.AbstractEuclideanSpace
numDimensions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
-
-
-
Field Detail
-
offset
protected final int offset
Offset of this cursor
-
size
protected final int size
Size of this cursor
-
type
protected final T extends NativeType<T> type
An instance of T
-
img
protected final ArrayImg<T extends NativeType<T>,?> img
Source image
-
lastIndex
protected final int lastIndex
Last index
-
-
Constructor Detail
-
AbstractArrayCursor
protected AbstractArrayCursor(AbstractArrayCursor<T> cursor)
TODO Javadoc- Parameters:
cursor
-
-
-
Method Detail
-
get
public T get()
Description copied from interface:Sampler
Access the actual T instance providing access to a pixel, sub-pixel or integral region value theSampler
points at.
-
hasNext
public boolean hasNext()
Description copied from interface:Iterator
Returns true if another step forward is possible.- Returns:
- true, if there is another step forward is possible, otherwise false
-
jumpFwd
public void jumpFwd(long steps)
Description copied from class:AbstractCursorInt
Highly recommended to override this with a more efficient version.- Specified by:
jumpFwd
in interfaceIterator
- Overrides:
jumpFwd
in classAbstractCursorInt<T extends NativeType<T>>
- Parameters:
steps
- number of steps to move forward
-
fwd
public void fwd()
Description copied from interface:Iterator
Move forward.
-
reset
public void reset()
Description copied from interface:Iterator
Reset theIterator
, that is put it to where it would be if newly created.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractCursorInt<T extends NativeType<T>>
-
getIntPosition
public int getIntPosition(int dim)
Description copied from interface:Localizable
Return the current position in a given dimension.- Parameters:
dim
- dimension- Returns:
- dimension of current position
-
localize
public void localize(int[] position)
Description copied from interface:Localizable
Write the current position into the passed array.- Parameters:
position
- receives current position
-
-