public class TwoDimensionalIntArray extends TwoDimensionalIntReadAccess.Base implements TwoDimensionalIntAccess
TwoDimensionalIntReadAccess.Base
EMPTY
Constructor and Description |
---|
TwoDimensionalIntArray(int ySize,
int... values)
Constructor.
|
TwoDimensionalIntArray(int xSize,
int ySize)
Constructor.
|
TwoDimensionalIntArray(int xSize,
int ySize,
java.util.function.IntBinaryOperator filler)
Initializing constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getValueAt(int ix,
int iy)
Get the value at the given indexes.
|
void |
setValueAt(int 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
|
asBase
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
changeAllValues, changeValueAt, fillValuesByIndex, setElementAt, subAtX, subAtY, transposed
asBase, getElementAt, singleton
changeAll, changeAll, createConstant, createIndexed, createNulled, createSupplied, empty, fillByIndex, setElement, zeroX, zeroY
equal, getElement, getNumDimensions, getNumElements, getSize, getSizes, hash, toString, view, visitAll, visitAll, xIterable, xIterator, yIterable, yIterator
change, setAll, setFrom, setFrom, setFrom
empty, linearized
public TwoDimensionalIntArray(int xSize, int ySize)
0
values.xSize
- X size of arrayySize
- Y size of arrayTwoDimensionalIntArray(int, int, IntBinaryOperator)
public TwoDimensionalIntArray(int xSize, int ySize, @NotNull java.util.function.IntBinaryOperator filler)
xSize
- X size of arrayySize
- Y size of arrayfiller
- setter function which provides the value to set for each index combinationTwoDimensionalIntAccess.fillValuesByIndex(java.util.function.IntBinaryOperator)
public TwoDimensionalIntArray(int ySize, int... 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 void setValueAt(int value, int ix, int iy)
setValueAt
in interface TwoDimensionalIntAccess
value
- value to setix
- X indexiy
- Y indexpublic int getValueAt(int ix, int iy)
getValueAt
in interface TwoDimensionalIntReadAccess
ix
- X indexiy
- Y indexpublic int sizeX()
TwoDimensionalReadAccess
sizeX
in interface TwoDimensionalReadAccess<java.lang.Integer>
public int sizeY()
TwoDimensionalReadAccess
sizeY
in interface TwoDimensionalReadAccess<java.lang.Integer>