public class NativeBoolType extends AbstractIntegerType<NativeBoolType> implements BooleanType<NativeBoolType>, NativeType<NativeBoolType>
NativeType
backed by boolean
.Modifier and Type | Field and Description |
---|---|
protected BooleanAccess |
dataAccess |
protected NativeImg<?,? extends BooleanAccess> |
img |
Constructor and Description |
---|
NativeBoolType() |
NativeBoolType(boolean value) |
NativeBoolType(BooleanAccess access) |
NativeBoolType(NativeImg<?,? extends BooleanAccess> boolStorage) |
Modifier and Type | Method and Description |
---|---|
void |
add(NativeBoolType c) |
void |
and(NativeBoolType c) |
int |
compareTo(NativeBoolType c) |
NativeBoolType |
copy()
|
NativeBoolType |
createVariable()
Creates a new
Type variable which can only store one value. |
void |
dec() |
void |
div(NativeBoolType c) |
NativeBoolType |
duplicateTypeOnSameNativeImg()
Creates a new
NativeType which stores in the same physical array. |
boolean |
equals(Object obj) |
boolean |
get()
Returns the primitive boolean value that is used to store this type.
|
BigInteger |
getBigInteger() |
int |
getBitsPerPixel() |
Fraction |
getEntitiesPerPixel()
Get the number of entities in the storage array required to store one
pixel value.
|
int |
getInteger() |
long |
getIntegerLong() |
double |
getMaxValue() |
double |
getMinValue() |
NativeTypeFactory<NativeBoolType,BooleanAccess> |
getNativeTypeFactory() |
int |
hashCode() |
void |
inc() |
Index |
index()
Get the (modifiable) index into the current data array.
|
void |
mul(double c) |
void |
mul(float c) |
void |
mul(NativeBoolType c) |
void |
not() |
void |
or(NativeBoolType c) |
void |
set(boolean f)
Sets the primitive boolean value that is used to store this type.
|
void |
set(NativeBoolType c)
Sets the value of another
Type . |
void |
setBigInteger(BigInteger b) |
void |
setInteger(int f) |
void |
setInteger(long f) |
void |
setOne() |
void |
setZero() |
void |
sub(NativeBoolType c) |
String |
toString() |
void |
updateContainer(Object c)
This method is used by an accessor (e.g., a
Cursor ) to request an
update of the current data array. |
boolean |
valueEquals(NativeBoolType t) |
void |
xor(NativeBoolType c) |
getMinIncrement, getRealDouble, getRealFloat, setReal, setReal
getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, pow, pow, setImaginary, setImaginary
complexConjugate, setComplexNumber, setComplexNumber
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getMinIncrement
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, getRealDouble, getRealFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary, setReal, setReal
pow
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
protected final NativeImg<?,? extends BooleanAccess> img
protected BooleanAccess dataAccess
public NativeBoolType(NativeImg<?,? extends BooleanAccess> boolStorage)
public NativeBoolType(boolean value)
public NativeBoolType(BooleanAccess access)
public NativeBoolType()
public NativeTypeFactory<NativeBoolType,BooleanAccess> getNativeTypeFactory()
getNativeTypeFactory
in interface NativeType<NativeBoolType>
public NativeBoolType duplicateTypeOnSameNativeImg()
NativeType
NativeType
which stores in the same physical array.
This is only used internally.duplicateTypeOnSameNativeImg
in interface NativeType<NativeBoolType>
NativeType
instance working on the same
NativeImg
public Fraction getEntitiesPerPixel()
NativeType
getEntitiesPerPixel
in interface NativeType<NativeBoolType>
public void updateContainer(Object c)
NativeType
Cursor
) to request an
update of the current data array.
As an example consider a CellCursor
moving on a CellImg
.
The cursor maintains a NativeType
which provides access to the
image data. When the cursor moves from one cell to the next, the
underlying data array of the NativeType
must be switched to the
data array of the new cell.
To achieve this, the CellCursor
calls updateContainer()
with itself as the argument. updateContainer()
in turn will call
NativeImg.update(Object)
on it's container, passing along the
reference to the cursor. In this example, the container would be a
CellImg
. While the NativeType
does not know about the
type of the cursor, the container does. CellImg
knows that it is
passed a CellCursor
instance, which can be used to figure out the
current cell and the underlying data array, which is then returned to the
NativeType
.
The idea behind this concept is maybe not obvious. The NativeType
knows 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 of NativeType
.
updateContainer
in interface NativeType<NativeBoolType>
c
- reference to an accessor which can be passed on to the
container (which will know what to do with it).public Index index()
NativeType
index
in interface NativeType<NativeBoolType>
public boolean get()
get
in interface BooleanType<NativeBoolType>
public void set(boolean f)
set
in interface BooleanType<NativeBoolType>
public void set(NativeBoolType c)
Type
Type
.set
in interface Type<NativeBoolType>
set
in class AbstractRealType<NativeBoolType>
c
- the new valuepublic void and(NativeBoolType c)
and
in interface BooleanType<NativeBoolType>
public void or(NativeBoolType c)
or
in interface BooleanType<NativeBoolType>
public void xor(NativeBoolType c)
xor
in interface BooleanType<NativeBoolType>
public void not()
not
in interface BooleanType<NativeBoolType>
public void add(NativeBoolType c)
add
in interface Add<NativeBoolType>
add
in class AbstractRealType<NativeBoolType>
public void div(NativeBoolType c)
div
in interface Div<NativeBoolType>
div
in class AbstractRealType<NativeBoolType>
public void mul(NativeBoolType c)
mul
in interface Mul<NativeBoolType>
mul
in class AbstractRealType<NativeBoolType>
public void sub(NativeBoolType c)
sub
in interface Sub<NativeBoolType>
sub
in class AbstractRealType<NativeBoolType>
public void mul(float c)
mul
in interface MulFloatingPoint
mul
in class AbstractRealType<NativeBoolType>
public void mul(double c)
mul
in interface MulFloatingPoint
mul
in class AbstractRealType<NativeBoolType>
public void setOne()
setOne
in interface SetOne
setOne
in class AbstractIntegerType<NativeBoolType>
public void setZero()
setZero
in interface SetZero
setZero
in class AbstractIntegerType<NativeBoolType>
public void inc()
inc
in interface RealType<NativeBoolType>
inc
in class AbstractIntegerType<NativeBoolType>
public void dec()
dec
in interface RealType<NativeBoolType>
dec
in class AbstractIntegerType<NativeBoolType>
public String toString()
toString
in class AbstractIntegerType<NativeBoolType>
public int getBitsPerPixel()
getBitsPerPixel
in interface RealType<NativeBoolType>
public boolean valueEquals(NativeBoolType t)
valueEquals
in interface ValueEquals<NativeBoolType>
valueEquals
in class AbstractIntegerType<NativeBoolType>
public boolean equals(Object obj)
equals
in class AbstractIntegerType<NativeBoolType>
public int hashCode()
hashCode
in class AbstractIntegerType<NativeBoolType>
public int compareTo(NativeBoolType c)
compareTo
in interface Comparable<NativeBoolType>
compareTo
in class AbstractIntegerType<NativeBoolType>
public NativeBoolType createVariable()
Type
Type
variable which can only store one value.createVariable
in interface Type<NativeBoolType>
Type
variablepublic NativeBoolType copy()
Type
copy
in interface Type<NativeBoolType>
Type
variablepublic double getMaxValue()
getMaxValue
in interface RealType<NativeBoolType>
public double getMinValue()
getMinValue
in interface RealType<NativeBoolType>
public int getInteger()
getInteger
in interface IntegerType<NativeBoolType>
public long getIntegerLong()
getIntegerLong
in interface IntegerType<NativeBoolType>
public BigInteger getBigInteger()
getBigInteger
in interface IntegerType<NativeBoolType>
public void setInteger(int f)
setInteger
in interface IntegerType<NativeBoolType>
public void setInteger(long f)
setInteger
in interface IntegerType<NativeBoolType>
public void setBigInteger(BigInteger b)
setBigInteger
in interface IntegerType<NativeBoolType>
Copyright © 2015–2022 ImgLib2. All rights reserved.