public abstract class GenericLongType<T extends GenericLongType<T>> extends AbstractIntegerType<T> implements NativeType<T>
Modifier and Type | Field and Description |
---|---|
protected LongAccess |
dataAccess |
protected NativeImg<?,? extends LongAccess> |
img |
Constructor and Description |
---|
GenericLongType() |
GenericLongType(long value) |
GenericLongType(LongAccess access) |
GenericLongType(NativeImg<?,? extends LongAccess> longStorage) |
Modifier and Type | Method and Description |
---|---|
void |
add(T c) |
int |
compareTo(T c) |
void |
dec() |
void |
decIndex()
Decrement the index into the current data array.
|
void |
decIndex(int decrement)
Decrease the index into the current data array by
decrement
steps. |
void |
div(T c) |
int |
getBitsPerPixel() |
Fraction |
getEntitiesPerPixel()
Get the number of entities in the storage array required to store one
pixel value.
|
int |
getIndex()
Get the current index into the current data array.
|
long |
getLong()
Returns the primitive long value that is used to store this type.
|
protected long |
getValue()
Deprecated.
Use
getLong() instead. |
int |
hashCode() |
void |
inc() |
void |
incIndex()
Increment the index into the current data array.
|
void |
incIndex(int increment)
Increases the index into the current data array by
increment
steps. |
void |
mul(double c) |
void |
mul(float c) |
void |
mul(T c) |
void |
set(T c)
Sets the value of another
Type . |
void |
setLong(long f)
Sets the primitive long value that is used to store this type.
|
void |
setOne() |
protected void |
setValue(long f)
Deprecated.
Use
setLong(long) instead. |
void |
setZero() |
void |
sub(T c) |
String |
toString() |
void |
updateContainer(Object c)
This method is used by an accessor (e.g., a
Cursor ) to request an
update of the current data array. |
void |
updateIndex(int index)
Set the index into the current data array.
|
boolean |
valueEquals(T t) |
getMinIncrement, getRealDouble, getRealFloat, setReal, setReal
equals, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setImaginary, setImaginary
complexConjugate, setComplexNumber, setComplexNumber
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
createSuitableNativeImg, duplicateTypeOnSameNativeImg
copy, createVariable
getBigInteger, getInteger, getIntegerLong, setBigInteger, setInteger, setInteger
getMaxValue, getMinValue
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary
protected final NativeImg<?,? extends LongAccess> img
protected LongAccess dataAccess
public GenericLongType(NativeImg<?,? extends LongAccess> longStorage)
public GenericLongType(long value)
public GenericLongType(LongAccess access)
public GenericLongType()
public Fraction getEntitiesPerPixel()
NativeType
getEntitiesPerPixel
in interface NativeType<T extends GenericLongType<T>>
public void updateContainer(Object c)
NativeType
Cursor
) to request an
update of the current data array.
As an example consider a CellCursor
moving on a CellImg
.
The cursor maintains a NativeType
which provides access to the
image data. When the cursor moves from one cell to the next, the
underlying data array of the NativeType
must be switched to the
data array of the new cell.
To achieve this, the CellCursor
calls updateContainer()
with itself as the argument. updateContainer()
in turn will call
NativeImg.update(Object)
on it's container, passing along the
reference to the cursor. In this example, the container would be a
CellImg
. While the NativeType
does not know about the
type of the cursor, the container does. CellImg
knows that it is
passed a CellCursor
instance, which can be used to figure out the
current cell and the underlying data array, which is then returned to the
NativeType
.
The idea behind this concept is maybe not obvious. The NativeType
knows which basic type is used (float, int, byte, ...). However, it does
not know how the data is stored (ArrayImg
, CellImg
, ...).
This prevents the need for multiple implementations of NativeType
.
updateContainer
in interface NativeType<T extends GenericLongType<T>>
c
- reference to an accessor which can be passed on to the
container (which will know what to do with it).@Deprecated protected long getValue()
getLong()
instead.@Deprecated protected void setValue(long f)
setLong(long)
instead.public long getLong()
public void setLong(long f)
public void mul(float c)
mul
in interface MulFloatingPoint
mul
in class AbstractRealType<T extends GenericLongType<T>>
public void mul(double c)
mul
in interface MulFloatingPoint
mul
in class AbstractRealType<T extends GenericLongType<T>>
public void add(T c)
add
in interface Add<T extends GenericLongType<T>>
add
in class AbstractRealType<T extends GenericLongType<T>>
public void div(T c)
div
in interface Div<T extends GenericLongType<T>>
div
in class AbstractRealType<T extends GenericLongType<T>>
public void mul(T c)
mul
in interface Mul<T extends GenericLongType<T>>
mul
in class AbstractRealType<T extends GenericLongType<T>>
public void sub(T c)
sub
in interface Sub<T extends GenericLongType<T>>
sub
in class AbstractRealType<T extends GenericLongType<T>>
public int hashCode()
hashCode
in class AbstractIntegerType<T extends GenericLongType<T>>
public int compareTo(T c)
compareTo
in interface Comparable<T extends GenericLongType<T>>
compareTo
in class AbstractIntegerType<T extends GenericLongType<T>>
public void set(T c)
Type
Type
.set
in interface Type<T extends GenericLongType<T>>
set
in class AbstractRealType<T extends GenericLongType<T>>
c
- the new valuepublic void setOne()
setOne
in interface SetOne
setOne
in class AbstractIntegerType<T extends GenericLongType<T>>
public void setZero()
setZero
in interface SetZero
setZero
in class AbstractIntegerType<T extends GenericLongType<T>>
public void inc()
inc
in interface RealType<T extends GenericLongType<T>>
inc
in class AbstractIntegerType<T extends GenericLongType<T>>
public void dec()
dec
in interface RealType<T extends GenericLongType<T>>
dec
in class AbstractIntegerType<T extends GenericLongType<T>>
public String toString()
toString
in class AbstractIntegerType<T extends GenericLongType<T>>
public void updateIndex(int index)
NativeType
This is used by accessors (e.g., a Cursor
) to position the
NativeType
in the container.
updateIndex
in interface NativeType<T extends GenericLongType<T>>
index
- the new array indexpublic int getIndex()
NativeType
This is used by accessors (e.g., a Cursor
) to position the
NativeType
in the container.
getIndex
in interface NativeType<T extends GenericLongType<T>>
public void incIndex()
NativeType
This is used by accessors (e.g., a Cursor
) to position the
NativeType
in the container.
incIndex
in interface NativeType<T extends GenericLongType<T>>
public void incIndex(int increment)
NativeType
increment
steps.
This is used by accessors (e.g., a Cursor
) to position the
NativeType
in the container.
incIndex
in interface NativeType<T extends GenericLongType<T>>
increment
- how many stepspublic void decIndex()
NativeType
This is used by accessors (e.g., a Cursor
) to position the
NativeType
in the container.
decIndex
in interface NativeType<T extends GenericLongType<T>>
public void decIndex(int decrement)
NativeType
decrement
steps.
This is used by accessors (e.g., a Cursor
) to position the
NativeType
in the container.
decIndex
in interface NativeType<T extends GenericLongType<T>>
decrement
- how many stepspublic int getBitsPerPixel()
getBitsPerPixel
in interface RealType<T extends GenericLongType<T>>
public boolean valueEquals(T t)
valueEquals
in interface ValueEquals<T extends GenericLongType<T>>
Copyright © 2009–2017 ImgLib2. All rights reserved.