public abstract class GenericIntType<T extends GenericIntType<T>> extends IntegerTypeImpl<T>
Constructor and Description |
---|
GenericIntType() |
GenericIntType(DirectAccessContainer<T,? extends IntAccess> intStorage) |
GenericIntType(int value) |
Modifier and Type | Method and Description |
---|---|
void |
add(T c) |
int |
compareTo(T c) |
void |
dec() |
void |
div(T c) |
protected int |
getValue() |
void |
inc() |
void |
mul(double c) |
void |
mul(float c) |
void |
mul(T c) |
void |
set(T c)
Sets the value of another
Type . |
void |
setOne() |
protected void |
setValue(int f) |
void |
setZero() |
void |
sub(T c) |
String |
toString() |
void |
updateContainer(Cursor<?> c)
|
getDefaultDisplay, getMinIncrement, getRealDouble, getRealFloat, setReal, setReal
decIndex, decIndex, getComplexDouble, getComplexFloat, getEntitiesPerPixel, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, incIndex, incIndex, setComplex, setComplex, updateIndex
complexConjugate, getPreferredRealPrecision, setComplexNumber, setComplexNumber
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInteger, getIntegerLong, setInteger, setInteger
getMaxValue, getMinValue
complexConjugate, getComplexDouble, getComplexFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, getPreferredRealPrecision, setComplex, setComplex, setComplexNumber, setComplexNumber
copy, createArray1D, createArray2D, createArray3D, createSuitableDirectAccessContainer, createVariable, decIndex, decIndex, duplicateTypeOnSameDirectAccessContainer, getEntitiesPerPixel, getIndex, incIndex, incIndex, updateIndex
public GenericIntType(DirectAccessContainer<T,? extends IntAccess> intStorage)
public GenericIntType(int value)
public GenericIntType()
public void updateContainer(Cursor<?> c)
Type
Cursor
s to update the data current data array
of the Type
, for example when moving from one Cell
to the next.
If it is only an Array
the Cursor
s never have to call that function.
The idea behind this concept is maybe not obvious. The Type
knows which basic type
is used (float, int, byte, ...) but does not know how it is stored (Array
, CellDirectAccessContainer
, ...) to
prevent multiple implementations of Type
.
That's why Type
asks the DataAccess
to give the actual basic array by passing the Cursor
that calls the method. The DataAccess
is also an Array
, CellDirectAccessContainer
, ... which
can then communicate with the ArrayCursor
, CellCursor
, ... and return the current basic type array.
A typical implementation of this method looks like that (this is the FloatType
implementation):
float[] v = floatStorage.getCurrentStorageArray( c );c
- - the Cursor
gives a link to itself so that the Type
tell its DataAccess
to get the new basic type array.protected int getValue()
protected void setValue(int f)
public void mul(float c)
mul
in interface NumericType<T extends GenericIntType<T>>
mul
in class RealTypeImpl<T extends GenericIntType<T>>
public void mul(double c)
mul
in interface NumericType<T extends GenericIntType<T>>
mul
in class RealTypeImpl<T extends GenericIntType<T>>
public void add(T c)
add
in interface NumericType<T extends GenericIntType<T>>
add
in class RealTypeImpl<T extends GenericIntType<T>>
public void div(T c)
div
in interface NumericType<T extends GenericIntType<T>>
div
in class RealTypeImpl<T extends GenericIntType<T>>
public void mul(T c)
mul
in interface NumericType<T extends GenericIntType<T>>
mul
in class RealTypeImpl<T extends GenericIntType<T>>
public void sub(T c)
sub
in interface NumericType<T extends GenericIntType<T>>
sub
in class RealTypeImpl<T extends GenericIntType<T>>
public int compareTo(T c)
compareTo
in interface Comparable<T extends GenericIntType<T>>
compareTo
in class IntegerTypeImpl<T extends GenericIntType<T>>
public void set(T c)
Type
Type
.set
in interface Type<T extends GenericIntType<T>>
set
in class RealTypeImpl<T extends GenericIntType<T>>
c
- - the new valuepublic void setOne()
setOne
in interface NumericType<T extends GenericIntType<T>>
setOne
in class IntegerTypeImpl<T extends GenericIntType<T>>
public void setZero()
setZero
in interface NumericType<T extends GenericIntType<T>>
setZero
in class IntegerTypeImpl<T extends GenericIntType<T>>
public void inc()
inc
in interface RealType<T extends GenericIntType<T>>
inc
in class IntegerTypeImpl<T extends GenericIntType<T>>
public void dec()
dec
in interface RealType<T extends GenericIntType<T>>
dec
in class IntegerTypeImpl<T extends GenericIntType<T>>
public String toString()
toString
in class IntegerTypeImpl<T extends GenericIntType<T>>
Copyright © 2015–2021 Fiji. All rights reserved.