public final class ByteMatrix extends Object
| Constructor and Description |
|---|
ByteMatrix(int width,
int height)
Creates a new ByteMatrix with the specified dimensions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear(byte value)
Clears all cells in the matrix to the specified value.
|
byte |
get(int x,
int y)
Gets the value at the specified coordinates.
|
byte[][] |
getArray() |
int |
getHeight() |
int |
getWidth() |
void |
set(int x,
int y,
boolean value)
Sets the value at the specified coordinates using a boolean value.
|
void |
set(int x,
int y,
byte value)
Sets the value at the specified coordinates.
|
void |
set(int x,
int y,
int value)
Sets the value at the specified coordinates using an int value.
|
String |
toString() |
public ByteMatrix(int width,
int height)
width - the width of the matrixheight - the height of the matrixpublic void clear(byte value)
value - the byte value to set all cells topublic byte get(int x,
int y)
x - the x coordinatey - the y coordinatepublic byte[][] getArray()
public int getHeight()
public int getWidth()
public void set(int x,
int y,
boolean value)
x - the x coordinatey - the y coordinatevalue - the boolean value to set (true = 1, false = 0)public void set(int x,
int y,
byte value)
x - the x coordinatey - the y coordinatevalue - the byte value to setpublic void set(int x,
int y,
int value)
x - the x coordinatey - the y coordinatevalue - the int value to set (will be cast to byte)