Class GenericIntType<T extends GenericIntType<T>>
- java.lang.Object
-
- net.imglib2.type.numeric.complex.AbstractComplexType<T>
-
- net.imglib2.type.numeric.real.AbstractRealType<T>
-
- net.imglib2.type.numeric.integer.AbstractIntegerType<T>
-
- net.imglib2.type.numeric.integer.GenericIntType<T>
-
- All Implemented Interfaces:
java.lang.Comparable<T>,NativeType<T>,ComplexType<T>,IntegerType<T>,NumericType<T>,RealType<T>,Add<T>,Div<T>,Mul<T>,MulFloatingPoint,Pow<T>,PowFloatingPoint,SetOne,SetZero,Sub<T>,ValueEquals<T>,Type<T>
- Direct Known Subclasses:
IntType,UnsignedIntType
public abstract class GenericIntType<T extends GenericIntType<T>> extends AbstractIntegerType<T> implements NativeType<T>
TODO
-
-
Constructor Summary
Constructors Constructor Description GenericIntType()GenericIntType(int value)GenericIntType(IntAccess access)GenericIntType(NativeImg<?,? extends IntAccess> intStorage)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(T c)intcompareTo(T other)voiddec()voiddiv(T c)booleanequals(java.lang.Object obj)intgetBitsPerPixel()FractiongetEntitiesPerPixel()Get the number of entities in the storage array required to store one pixel value.intgetInt()Returns the primitive int value that is used to store this type.abstract NativeTypeFactory<T,IntAccess>getNativeTypeFactory()protected intgetValue()Deprecated.UsegetInt()instead.inthashCode()voidinc()Indexindex()Get the (modifiable) index into the current data array.voidmul(double c)voidmul(float c)voidmul(T c)voidpow(double power)voidpow(T c)voidset(T c)Sets the value of anotherType.voidsetInt(int f)Sets the primitive int value that is used to store this type.voidsetOne()protected voidsetValue(int f)Deprecated.UsesetInt(int)instead.voidsetZero()voidsub(T c)java.lang.StringtoString()voidupdateContainer(java.lang.Object c)This method is used by an accessor (e.g., aCursor) to request an update of the current data array.booleanvalueEquals(T t)-
Methods inherited from class net.imglib2.type.numeric.integer.AbstractIntegerType
getMinIncrement, getRealDouble, getRealFloat, setReal, setReal
-
Methods inherited from class net.imglib2.type.numeric.real.AbstractRealType
getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setImaginary, setImaginary
-
Methods inherited from class net.imglib2.type.numeric.complex.AbstractComplexType
complexConjugate, setComplexNumber, setComplexNumber
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.type.numeric.ComplexType
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary
-
Methods inherited from interface net.imglib2.type.numeric.IntegerType
getBigInteger, getInteger, getIntegerLong, setBigInteger, setInteger, setInteger
-
Methods inherited from interface net.imglib2.type.NativeType
decIndex, decIndex, duplicateTypeOnSameNativeImg, getIndex, incIndex, incIndex, updateIndex
-
Methods inherited from interface net.imglib2.type.numeric.RealType
getMaxValue, getMinValue
-
Methods inherited from interface net.imglib2.type.Type
copy, createVariable
-
-
-
-
Method Detail
-
getEntitiesPerPixel
public Fraction getEntitiesPerPixel()
Description copied from interface:NativeTypeGet the number of entities in the storage array required to store one pixel value. A pixel value may be spread over several or less than one entity. For example, a complex number may require 2 entries of a float[] array to store one pixel. Or a 12-bit type might need 12/64th entries of a long[] array.- Specified by:
getEntitiesPerPixelin interfaceNativeType<T extends GenericIntType<T>>- Returns:
- the number of storage type entities required to store one pixel value.
-
updateContainer
public void updateContainer(java.lang.Object c)
Description copied from interface:NativeTypeThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.As an example consider a
CellCursormoving on aCellImg. The cursor maintains aNativeTypewhich provides access to the image data. When the cursor moves from one cell to the next, the underlying data array of theNativeTypemust be switched to the data array of the new cell.To achieve this, the
CellCursorcallsupdateContainer()with itself as the argument.updateContainer()in turn will callNativeImg.update(Object)on it's container, passing along the reference to the cursor. In this example, the container would be aCellImg. While theNativeTypedoes not know about the type of the cursor, the container does.CellImgknows that it is passed aCellCursorinstance, which can be used to figure out the current cell and the underlying data array, which is then returned to theNativeType.The idea behind this concept is maybe not obvious. The
NativeTypeknows 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 ofNativeType.- Specified by:
updateContainerin interfaceNativeType<T extends GenericIntType<T>>- Parameters:
c- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
index
public Index index()
Description copied from interface:NativeTypeGet the (modifiable) index into the current data array. The returned instance will always be the same for the same Type.- Specified by:
indexin interfaceNativeType<T extends GenericIntType<T>>
-
getNativeTypeFactory
public abstract NativeTypeFactory<T,IntAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<T extends GenericIntType<T>>
-
getValue
@Deprecated protected int getValue()
Deprecated.UsegetInt()instead.
-
setValue
@Deprecated protected void setValue(int f)
Deprecated.UsesetInt(int)instead.
-
getInt
public int getInt()
Returns the primitive int value that is used to store this type.- Returns:
- primitive int value
-
setInt
public void setInt(int f)
Sets the primitive int value that is used to store this type.
-
mul
public void mul(float c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericIntType<T>>
-
mul
public void mul(double c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericIntType<T>>
-
add
public void add(T c)
- Specified by:
addin interfaceAdd<T extends GenericIntType<T>>- Overrides:
addin classAbstractRealType<T extends GenericIntType<T>>
-
div
public void div(T c)
- Specified by:
divin interfaceDiv<T extends GenericIntType<T>>- Overrides:
divin classAbstractRealType<T extends GenericIntType<T>>
-
mul
public void mul(T c)
- Specified by:
mulin interfaceMul<T extends GenericIntType<T>>- Overrides:
mulin classAbstractRealType<T extends GenericIntType<T>>
-
sub
public void sub(T c)
- Specified by:
subin interfaceSub<T extends GenericIntType<T>>- Overrides:
subin classAbstractRealType<T extends GenericIntType<T>>
-
pow
public void pow(T c)
- Specified by:
powin interfacePow<T extends GenericIntType<T>>- Overrides:
powin classAbstractRealType<T extends GenericIntType<T>>
-
pow
public void pow(double power)
- Specified by:
powin interfacePowFloatingPoint- Overrides:
powin classAbstractRealType<T extends GenericIntType<T>>
-
set
public void set(T c)
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<T extends GenericIntType<T>>- Overrides:
setin classAbstractRealType<T extends GenericIntType<T>>- Parameters:
c- the new value
-
setOne
public void setOne()
- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classAbstractIntegerType<T extends GenericIntType<T>>
-
setZero
public void setZero()
- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classAbstractIntegerType<T extends GenericIntType<T>>
-
inc
public void inc()
- Specified by:
incin interfaceRealType<T extends GenericIntType<T>>- Overrides:
incin classAbstractIntegerType<T extends GenericIntType<T>>
-
dec
public void dec()
- Specified by:
decin interfaceRealType<T extends GenericIntType<T>>- Overrides:
decin classAbstractIntegerType<T extends GenericIntType<T>>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractIntegerType<T extends GenericIntType<T>>
-
getBitsPerPixel
public int getBitsPerPixel()
- Specified by:
getBitsPerPixelin interfaceRealType<T extends GenericIntType<T>>
-
compareTo
public int compareTo(T other)
- Specified by:
compareToin interfacejava.lang.Comparable<T extends GenericIntType<T>>- Overrides:
compareToin classAbstractIntegerType<T extends GenericIntType<T>>
-
valueEquals
public boolean valueEquals(T t)
- Specified by:
valueEqualsin interfaceValueEquals<T extends GenericIntType<T>>- Overrides:
valueEqualsin classAbstractIntegerType<T extends GenericIntType<T>>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractIntegerType<T extends GenericIntType<T>>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractIntegerType<T extends GenericIntType<T>>
-
-