Class GenericShortType<T extends GenericShortType<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.GenericShortType<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:
ShortType,UnsignedShortType
public abstract class GenericShortType<T extends GenericShortType<T>> extends AbstractIntegerType<T> implements NativeType<T>
Abstract base class fornativeIntegerTypes that encode their value into a 16bit short.
-
-
Field Summary
Fields Modifier and Type Field Description protected ShortAccessdataAccess(package private) Indexiprotected NativeImg<?,? extends ShortAccess>img
-
Constructor Summary
Constructors Constructor Description GenericShortType()GenericShortType(short value)GenericShortType(ShortAccess access)GenericShortType(NativeImg<?,? extends ShortAccess> shortStorage)
-
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.abstract NativeTypeFactory<T,ShortAccess>getNativeTypeFactory()shortgetShort()Returns the primitive short value that is used to store this type.protected shortgetValue()Deprecated.UsegetShort()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.voidsetOne()voidsetShort(short f)Sets the primitive short value that is used to store this type.protected voidsetValue(short f)Deprecated.UsesetShort(short)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, 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 ShortAccess> img
-
dataAccess
protected ShortAccess dataAccess
-
-
Constructor Detail
-
GenericShortType
public GenericShortType(NativeImg<?,? extends ShortAccess> shortStorage)
-
GenericShortType
public GenericShortType(short value)
-
GenericShortType
public GenericShortType(ShortAccess access)
-
GenericShortType
public GenericShortType()
-
-
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 GenericShortType<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 GenericShortType<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 GenericShortType<T>>
-
getNativeTypeFactory
public abstract NativeTypeFactory<T,ShortAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<T extends GenericShortType<T>>
-
getValue
@Deprecated protected short getValue()
Deprecated.UsegetShort()instead.
-
setValue
@Deprecated protected void setValue(short f)
Deprecated.UsesetShort(short)instead.
-
getShort
public short getShort()
Returns the primitive short value that is used to store this type.- Returns:
- primitive short value
-
setShort
public void setShort(short f)
Sets the primitive short value that is used to store this type.
-
mul
public void mul(float c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericShortType<T>>
-
mul
public void mul(double c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericShortType<T>>
-
add
public void add(T c)
- Specified by:
addin interfaceAdd<T extends GenericShortType<T>>- Overrides:
addin classAbstractRealType<T extends GenericShortType<T>>
-
div
public void div(T c)
- Specified by:
divin interfaceDiv<T extends GenericShortType<T>>- Overrides:
divin classAbstractRealType<T extends GenericShortType<T>>
-
mul
public void mul(T c)
- Specified by:
mulin interfaceMul<T extends GenericShortType<T>>- Overrides:
mulin classAbstractRealType<T extends GenericShortType<T>>
-
sub
public void sub(T c)
- Specified by:
subin interfaceSub<T extends GenericShortType<T>>- Overrides:
subin classAbstractRealType<T extends GenericShortType<T>>
-
set
public void set(T c)
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<T extends GenericShortType<T>>- Overrides:
setin classAbstractRealType<T extends GenericShortType<T>>- Parameters:
c- the new value
-
setOne
public void setOne()
- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classAbstractIntegerType<T extends GenericShortType<T>>
-
setZero
public void setZero()
- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classAbstractIntegerType<T extends GenericShortType<T>>
-
inc
public void inc()
- Specified by:
incin interfaceRealType<T extends GenericShortType<T>>- Overrides:
incin classAbstractIntegerType<T extends GenericShortType<T>>
-
dec
public void dec()
- Specified by:
decin interfaceRealType<T extends GenericShortType<T>>- Overrides:
decin classAbstractIntegerType<T extends GenericShortType<T>>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractIntegerType<T extends GenericShortType<T>>
-
getBitsPerPixel
public int getBitsPerPixel()
- Specified by:
getBitsPerPixelin interfaceRealType<T extends GenericShortType<T>>
-
compareTo
public int compareTo(T other)
- Specified by:
compareToin interfacejava.lang.Comparable<T extends GenericShortType<T>>- Overrides:
compareToin classAbstractIntegerType<T extends GenericShortType<T>>
-
valueEquals
public boolean valueEquals(T t)
- Specified by:
valueEqualsin interfaceValueEquals<T extends GenericShortType<T>>- Overrides:
valueEqualsin classAbstractIntegerType<T extends GenericShortType<T>>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractIntegerType<T extends GenericShortType<T>>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractIntegerType<T extends GenericShortType<T>>
-
-