public class SmallTwoDimensionalBooleanArray extends TwoDimensionalBooleanReadAccess.Base implements TwoDimensionalBooleanAccess
This internally maps to a one-dimensional boolean array which is created faster.
Because of the mapping the size of the dimensions is restricted in a way that the
number of elements in this array (i.e. the multiplication of its X and Y size) is less
than Integer.MAX_VALUE. Use TwoDimensionalBooleanArray if you are not
sure to always obey this restriction, or SmallTwoDimensionalBitArray in cases
where you just need up to a factor of 64 more space.
TwoDimensionalBooleanReadAccess.BaseEMPTY| Constructor and Description |
|---|
SmallTwoDimensionalBooleanArray(int ySize,
boolean... values)
Constructor.
|
SmallTwoDimensionalBooleanArray(int xSize,
int ySize)
Constructor.
|
SmallTwoDimensionalBooleanArray(int xSize,
int ySize,
IntPredicate2 filler)
Initializing constructor.
|
SmallTwoDimensionalBooleanArray(TwoDimensionalBooleanReadAccess array)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
SmallTwoDimensionalBooleanArray |
copy()
Get a copy of this array.
|
boolean |
getValueAt(int ix,
int iy)
Get the value at the given indexes.
|
void |
invertX()
Invert the row order in X direction.
|
void |
invertY()
Invert the row order in Y direction.
|
void |
setValueAt(boolean value,
int ix,
int iy)
Set the value at the given indexes.
|
int |
sizeX()
Get the number of elements in X direction.
|
int |
sizeY()
Get the number of elements in Y direction
|
asBaseequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitchangeAllValues, changeValueAt, fillValuesByIndex, setElementAt, subAtX, subAtY, transposedasBase, getElementAt, singletonchangeAll, changeAll, createConstant, createIndexed, createNulled, createSupplied, empty, fillByIndex, setElement, zeroX, zeroYequal, getElement, getNumDimensions, getNumElements, getSize, getSizes, hash, toString, view, visitAll, visitAll, xIterable, xIterator, yIterable, yIteratorchange, setAll, setFrom, setFrom, setFromempty, linearizedpublic SmallTwoDimensionalBooleanArray(int xSize,
int ySize)
0.0 values.xSize - X size of arrayySize - Y size of arrayjava.lang.IllegalArgumentException - on negative sizes or if linearized size becoms too largeSmallTwoDimensionalBooleanArray(int, int, IntPredicate2)public SmallTwoDimensionalBooleanArray(int xSize,
int ySize,
@NotNull
IntPredicate2 filler)
xSize - X size of arrayySize - Y size of arrayfiller - setter function which provides the value to set for each index combinationjava.lang.IllegalArgumentException - on negative sizes or if linearized size becoms too largeTwoDimensionalBooleanAccess.fillValuesByIndex(IntPredicate2)public SmallTwoDimensionalBooleanArray(int ySize,
boolean... values)
ySize - size in y directionvalues - values in order, the first ySize values
will become row 0, the second ySize values
row 1, and so on. Needs a multiple of ySize values.public SmallTwoDimensionalBooleanArray(@NotNull TwoDimensionalBooleanReadAccess array)
array - array to copyjava.lang.IllegalArgumentException - on negative sizes or if linearized size becoms too largepublic void invertX()
public void invertY()
public void setValueAt(boolean value,
int ix,
int iy)
setValueAt in interface TwoDimensionalBooleanAccessvalue - value to setix - X indexiy - Y indexpublic boolean getValueAt(int ix,
int iy)
getValueAt in interface TwoDimensionalBooleanReadAccessix - X indexiy - Y indexpublic int sizeX()
TwoDimensionalReadAccesssizeX in interface TwoDimensionalReadAccess<java.lang.Boolean>public int sizeY()
TwoDimensionalReadAccesssizeY in interface TwoDimensionalReadAccess<java.lang.Boolean>@NotNull public SmallTwoDimensionalBooleanArray copy()