Class GenericLongType<T extends GenericLongType<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.GenericLongType<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:
LongType,UnsignedLongType
public abstract class GenericLongType<T extends GenericLongType<T>> extends AbstractIntegerType<T> implements NativeType<T>
Abstract superclass for Long types.
-
-
Field Summary
Fields Modifier and Type Field Description protected LongAccessdataAccess(package private) Indexiprotected NativeImg<?,? extends LongAccess>img
-
Constructor Summary
Constructors Constructor Description GenericLongType()GenericLongType(long value)GenericLongType(LongAccess access)GenericLongType(NativeImg<?,? extends LongAccess> longStorage)
-
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.longgetLong()Returns the primitive long value that is used to store this type.abstract NativeTypeFactory<T,LongAccess>getNativeTypeFactory()protected longgetValue()Deprecated.UsegetLong()instead.inthashCode()voidinc()Indexindex()Get the (modifiable) index into the current data array.voidmul(double c)voidmul(float c)voidmul(T c)voidset(T c)Sets the value of anotherType.voidsetLong(long f)Sets the primitive long value that is used to store this type.voidsetOne()protected voidsetValue(long f)Deprecated.UsesetLong(long)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 other)-
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, pow, pow, 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.operators.PowFloatingPoint
pow
-
Methods inherited from interface net.imglib2.type.numeric.RealType
getMaxValue, getMinValue
-
Methods inherited from interface net.imglib2.type.Type
copy, createVariable
-
-
-
-
Field Detail
-
i
final Index i
-
img
protected final NativeImg<?,? extends LongAccess> img
-
dataAccess
protected LongAccess dataAccess
-
-
Constructor Detail
-
GenericLongType
public GenericLongType(NativeImg<?,? extends LongAccess> longStorage)
-
GenericLongType
public GenericLongType(long value)
-
GenericLongType
public GenericLongType(LongAccess access)
-
GenericLongType
public GenericLongType()
-
-
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 GenericLongType<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 GenericLongType<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 GenericLongType<T>>
-
getNativeTypeFactory
public abstract NativeTypeFactory<T,LongAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<T extends GenericLongType<T>>
-
getValue
@Deprecated protected long getValue()
Deprecated.UsegetLong()instead.
-
setValue
@Deprecated protected void setValue(long f)
Deprecated.UsesetLong(long)instead.
-
getLong
public long getLong()
Returns the primitive long value that is used to store this type.- Returns:
- primitive long value
-
setLong
public void setLong(long f)
Sets the primitive long value that is used to store this type.
-
mul
public void mul(float c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericLongType<T>>
-
mul
public void mul(double c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericLongType<T>>
-
add
public void add(T c)
- Specified by:
addin interfaceAdd<T extends GenericLongType<T>>- Overrides:
addin classAbstractRealType<T extends GenericLongType<T>>
-
div
public void div(T c)
- Specified by:
divin interfaceDiv<T extends GenericLongType<T>>- Overrides:
divin classAbstractRealType<T extends GenericLongType<T>>
-
mul
public void mul(T c)
- Specified by:
mulin interfaceMul<T extends GenericLongType<T>>- Overrides:
mulin classAbstractRealType<T extends GenericLongType<T>>
-
sub
public void sub(T c)
- Specified by:
subin interfaceSub<T extends GenericLongType<T>>- Overrides:
subin classAbstractRealType<T extends GenericLongType<T>>
-
set
public void set(T c)
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<T extends GenericLongType<T>>- Overrides:
setin classAbstractRealType<T extends GenericLongType<T>>- Parameters:
c- the new value
-
setOne
public void setOne()
- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classAbstractIntegerType<T extends GenericLongType<T>>
-
setZero
public void setZero()
- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classAbstractIntegerType<T extends GenericLongType<T>>
-
inc
public void inc()
- Specified by:
incin interfaceRealType<T extends GenericLongType<T>>- Overrides:
incin classAbstractIntegerType<T extends GenericLongType<T>>
-
dec
public void dec()
- Specified by:
decin interfaceRealType<T extends GenericLongType<T>>- Overrides:
decin classAbstractIntegerType<T extends GenericLongType<T>>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractIntegerType<T extends GenericLongType<T>>
-
getBitsPerPixel
public int getBitsPerPixel()
- Specified by:
getBitsPerPixelin interfaceRealType<T extends GenericLongType<T>>
-
compareTo
public int compareTo(T other)
- Specified by:
compareToin interfacejava.lang.Comparable<T extends GenericLongType<T>>- Overrides:
compareToin classAbstractIntegerType<T extends GenericLongType<T>>
-
valueEquals
public boolean valueEquals(T other)
- Specified by:
valueEqualsin interfaceValueEquals<T extends GenericLongType<T>>- Overrides:
valueEqualsin classAbstractIntegerType<T extends GenericLongType<T>>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractIntegerType<T extends GenericLongType<T>>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractIntegerType<T extends GenericLongType<T>>
-
-