Class NativeBoolType
- java.lang.Object
-
- net.imglib2.type.numeric.complex.AbstractComplexType<T>
-
- net.imglib2.type.numeric.real.AbstractRealType<T>
-
- net.imglib2.type.numeric.integer.AbstractIntegerType<NativeBoolType>
-
- net.imglib2.type.logic.NativeBoolType
-
- All Implemented Interfaces:
java.lang.Comparable<NativeBoolType>,BooleanType<NativeBoolType>,NativeType<NativeBoolType>,ComplexType<NativeBoolType>,IntegerType<NativeBoolType>,NumericType<NativeBoolType>,RealType<NativeBoolType>,Add<NativeBoolType>,Div<NativeBoolType>,Mul<NativeBoolType>,MulFloatingPoint,Pow<NativeBoolType>,PowFloatingPoint,SetOne,SetZero,Sub<NativeBoolType>,ValueEquals<NativeBoolType>,Type<NativeBoolType>
public class NativeBoolType extends AbstractIntegerType<NativeBoolType> implements BooleanType<NativeBoolType>, NativeType<NativeBoolType>
NativeTypebacked byboolean.
-
-
Field Summary
Fields Modifier and Type Field Description protected BooleanAccessdataAccess(package private) Indexiprotected NativeImg<?,? extends BooleanAccess>imgprivate static NativeTypeFactory<NativeBoolType,BooleanAccess>typeFactory
-
Constructor Summary
Constructors Constructor Description NativeBoolType()NativeBoolType(boolean value)NativeBoolType(BooleanAccess access)NativeBoolType(NativeImg<?,? extends BooleanAccess> boolStorage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(NativeBoolType c)voidand(NativeBoolType c)intcompareTo(NativeBoolType c)NativeBoolTypecopy()NativeBoolTypecreateVariable()Creates a newTypevariable which can only store one value.voiddec()voiddiv(NativeBoolType c)NativeBoolTypeduplicateTypeOnSameNativeImg()Creates a newNativeTypewhich stores in the same physical array.booleanequals(java.lang.Object obj)booleanget()Returns the primitive boolean value that is used to store this type.java.math.BigIntegergetBigInteger()intgetBitsPerPixel()FractiongetEntitiesPerPixel()Get the number of entities in the storage array required to store one pixel value.intgetInteger()longgetIntegerLong()doublegetMaxValue()doublegetMinValue()NativeTypeFactory<NativeBoolType,BooleanAccess>getNativeTypeFactory()inthashCode()voidinc()Indexindex()Get the (modifiable) index into the current data array.voidmul(double c)voidmul(float c)voidmul(NativeBoolType c)voidnot()voidor(NativeBoolType c)voidset(boolean f)Sets the primitive boolean value that is used to store this type.voidset(NativeBoolType c)Sets the value of anotherType.voidsetBigInteger(java.math.BigInteger b)voidsetInteger(int f)voidsetInteger(long f)voidsetOne()voidsetZero()voidsub(NativeBoolType 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(NativeBoolType t)voidxor(NativeBoolType c)-
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, getRealDouble, getRealFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary, setReal, setReal
-
Methods inherited from interface net.imglib2.type.NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
-
Methods inherited from interface net.imglib2.type.operators.PowFloatingPoint
pow
-
Methods inherited from interface net.imglib2.type.numeric.RealType
getMinIncrement
-
-
-
-
Field Detail
-
i
final Index i
-
img
protected final NativeImg<?,? extends BooleanAccess> img
-
dataAccess
protected BooleanAccess dataAccess
-
typeFactory
private static final NativeTypeFactory<NativeBoolType,BooleanAccess> typeFactory
-
-
Constructor Detail
-
NativeBoolType
public NativeBoolType(NativeImg<?,? extends BooleanAccess> boolStorage)
-
NativeBoolType
public NativeBoolType(boolean value)
-
NativeBoolType
public NativeBoolType(BooleanAccess access)
-
NativeBoolType
public NativeBoolType()
-
-
Method Detail
-
getNativeTypeFactory
public NativeTypeFactory<NativeBoolType,BooleanAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<NativeBoolType>
-
duplicateTypeOnSameNativeImg
public NativeBoolType duplicateTypeOnSameNativeImg()
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<NativeBoolType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
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<NativeBoolType>- 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<NativeBoolType>- 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<NativeBoolType>
-
get
public boolean get()
Returns the primitive boolean value that is used to store this type.- Specified by:
getin interfaceBooleanType<NativeBoolType>- Returns:
- primitive boolean value
-
set
public void set(boolean f)
Sets the primitive boolean value that is used to store this type.- Specified by:
setin interfaceBooleanType<NativeBoolType>
-
set
public void set(NativeBoolType c)
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<NativeBoolType>- Overrides:
setin classAbstractRealType<NativeBoolType>- Parameters:
c- the new value
-
and
public void and(NativeBoolType c)
- Specified by:
andin interfaceBooleanType<NativeBoolType>
-
or
public void or(NativeBoolType c)
- Specified by:
orin interfaceBooleanType<NativeBoolType>
-
xor
public void xor(NativeBoolType c)
- Specified by:
xorin interfaceBooleanType<NativeBoolType>
-
not
public void not()
- Specified by:
notin interfaceBooleanType<NativeBoolType>
-
add
public void add(NativeBoolType c)
- Specified by:
addin interfaceAdd<NativeBoolType>- Overrides:
addin classAbstractRealType<NativeBoolType>
-
div
public void div(NativeBoolType c)
- Specified by:
divin interfaceDiv<NativeBoolType>- Overrides:
divin classAbstractRealType<NativeBoolType>
-
mul
public void mul(NativeBoolType c)
- Specified by:
mulin interfaceMul<NativeBoolType>- Overrides:
mulin classAbstractRealType<NativeBoolType>
-
sub
public void sub(NativeBoolType c)
- Specified by:
subin interfaceSub<NativeBoolType>- Overrides:
subin classAbstractRealType<NativeBoolType>
-
mul
public void mul(float c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<NativeBoolType>
-
mul
public void mul(double c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<NativeBoolType>
-
setOne
public void setOne()
- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classAbstractIntegerType<NativeBoolType>
-
setZero
public void setZero()
- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classAbstractIntegerType<NativeBoolType>
-
inc
public void inc()
- Specified by:
incin interfaceRealType<NativeBoolType>- Overrides:
incin classAbstractIntegerType<NativeBoolType>
-
dec
public void dec()
- Specified by:
decin interfaceRealType<NativeBoolType>- Overrides:
decin classAbstractIntegerType<NativeBoolType>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractIntegerType<NativeBoolType>
-
getBitsPerPixel
public int getBitsPerPixel()
- Specified by:
getBitsPerPixelin interfaceRealType<NativeBoolType>
-
valueEquals
public boolean valueEquals(NativeBoolType t)
- Specified by:
valueEqualsin interfaceValueEquals<NativeBoolType>- Overrides:
valueEqualsin classAbstractIntegerType<NativeBoolType>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractIntegerType<NativeBoolType>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractIntegerType<NativeBoolType>
-
compareTo
public int compareTo(NativeBoolType c)
- Specified by:
compareToin interfacejava.lang.Comparable<NativeBoolType>- Overrides:
compareToin classAbstractIntegerType<NativeBoolType>
-
createVariable
public NativeBoolType createVariable()
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<NativeBoolType>- Returns:
- a new
Typevariable
-
copy
public NativeBoolType copy()
Description copied from interface:Type- Specified by:
copyin interfaceType<NativeBoolType>- Returns:
- a new
Typevariable
-
getMaxValue
public double getMaxValue()
- Specified by:
getMaxValuein interfaceRealType<NativeBoolType>
-
getMinValue
public double getMinValue()
- Specified by:
getMinValuein interfaceRealType<NativeBoolType>
-
getInteger
public int getInteger()
- Specified by:
getIntegerin interfaceIntegerType<NativeBoolType>
-
getIntegerLong
public long getIntegerLong()
- Specified by:
getIntegerLongin interfaceIntegerType<NativeBoolType>
-
getBigInteger
public java.math.BigInteger getBigInteger()
- Specified by:
getBigIntegerin interfaceIntegerType<NativeBoolType>
-
setInteger
public void setInteger(int f)
- Specified by:
setIntegerin interfaceIntegerType<NativeBoolType>
-
setInteger
public void setInteger(long f)
- Specified by:
setIntegerin interfaceIntegerType<NativeBoolType>
-
setBigInteger
public void setBigInteger(java.math.BigInteger b)
- Specified by:
setBigIntegerin interfaceIntegerType<NativeBoolType>
-
-