Class BitType
- All Implemented Interfaces:
Comparable<BitType>, BooleanType<BitType>, NativeType<BitType>, ComplexType<BitType>, IntegerType<BitType>, NumericType<BitType>, RealType<BitType>, Add<BitType>, Div<BitType>, Mul<BitType>, MulFloatingPoint, Pow<BitType>, PowFloatingPoint, SetOne, SetZero, Sub<BitType>, ValueEquals<BitType>, Type<BitType>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LongAccessprotected final Indexprotected final NativeImg<?, ? extends LongAccess> private static final NativeTypeFactory<BitType, LongAccess> -
Constructor Summary
ConstructorsConstructorDescriptionBitType()BitType(boolean value) BitType(LongAccess access) BitType(NativeImg<?, ? extends LongAccess> bitStorage) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidintcopy()Creates a newTypevariable which can only store one value.voiddec()voidCreates a newNativeTypewhich stores in the same physical array.booleanbooleanget()intGet the number of entities in the storage array required to store one pixel value.intlongdoubledoubleinthashCode()voidinc()index()Get the (modifiable) index into the current data array.voidmul(double c) voidmul(float c) voidvoidnot()voidvoidset(boolean value) voidSets the value of anotherType.voidvoidsetInteger(int f) voidsetInteger(long f) voidsetOne()voidsetZero()voidtoString()voidThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.booleanvoidMethods inherited from class AbstractIntegerType
getMinIncrement, getRealDouble, getRealFloat, setReal, setRealMethods inherited from class AbstractRealType
getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, pow, pow, setImaginary, setImaginaryMethods inherited from class AbstractComplexType
complexConjugate, setComplexNumber, setComplexNumberMethods inherited from interface ComplexType
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, getRealDouble, getRealFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary, setReal, setRealMethods inherited from interface NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndexMethods inherited from interface PowFloatingPoint
powMethods inherited from interface RealType
getMinIncrement
-
Field Details
-
i
-
img
-
dataAccess
-
typeFactory
-
-
Constructor Details
-
BitType
-
BitType
public BitType(boolean value) -
BitType
-
BitType
public BitType()
-
-
Method Details
-
updateContainer
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<BitType>- Parameters:
c- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
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<BitType>
-
duplicateTypeOnSameNativeImg
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<BitType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
- Specified by:
getNativeTypeFactoryin interfaceNativeType<BitType>
-
get
public boolean get()- Specified by:
getin interfaceBooleanType<BitType>
-
set
public void set(boolean value) - Specified by:
setin interfaceBooleanType<BitType>
-
getInteger
public int getInteger()- Specified by:
getIntegerin interfaceIntegerType<BitType>
-
getIntegerLong
public long getIntegerLong()- Specified by:
getIntegerLongin interfaceIntegerType<BitType>
-
getBigInteger
- Specified by:
getBigIntegerin interfaceIntegerType<BitType>
-
setInteger
public void setInteger(int f) - Specified by:
setIntegerin interfaceIntegerType<BitType>
-
setInteger
public void setInteger(long f) - Specified by:
setIntegerin interfaceIntegerType<BitType>
-
setBigInteger
- Specified by:
setBigIntegerin interfaceIntegerType<BitType>
-
getMaxValue
public double getMaxValue()- Specified by:
getMaxValuein interfaceRealType<BitType>
-
getMinValue
public double getMinValue()- Specified by:
getMinValuein interfaceRealType<BitType>
-
set
-
and
- Specified by:
andin interfaceBooleanType<BitType>
-
or
- Specified by:
orin interfaceBooleanType<BitType>
-
xor
- Specified by:
xorin interfaceBooleanType<BitType>
-
not
public void not()- Specified by:
notin interfaceBooleanType<BitType>
-
add
-
div
-
mul
-
sub
-
mul
public void mul(float c) - Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<BitType>
-
mul
public void mul(double c) - Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<BitType>
-
setOne
public void setOne()- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classAbstractIntegerType<BitType>
-
setZero
public void setZero()- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classAbstractIntegerType<BitType>
-
inc
-
dec
-
createVariable
-
copy
-
toString
- Overrides:
toStringin classAbstractIntegerType<BitType>
-
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<BitType>- Returns:
- the number of storage type entities required to store one pixel value.
-
getBitsPerPixel
public int getBitsPerPixel()- Specified by:
getBitsPerPixelin interfaceRealType<BitType>
-
compareTo
- Specified by:
compareToin interfaceComparable<BitType>- Overrides:
compareToin classAbstractIntegerType<BitType>
-
valueEquals
- Specified by:
valueEqualsin interfaceValueEquals<BitType>- Overrides:
valueEqualsin classAbstractIntegerType<BitType>
-
equals
- Overrides:
equalsin classAbstractIntegerType<BitType>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractIntegerType<BitType>
-