public class SimpleMatrix<T> extends Matrix<T>
Constructor and Description |
---|
SimpleMatrix(int width,
int height)
Constructor that creates a Matrix with the given height and width
|
SimpleMatrix(int width,
int height,
Matrix<T> matrix)
Creates a matrix with the given length and height and copies the values
of matrix that can fit in
|
SimpleMatrix(int width,
int height,
T value)
Constructor that creates a Matrix with the given height and width.
|
SimpleMatrix(Matrix<T> matrix)
Constructor that copies the given matrix
|
Modifier and Type | Method and Description |
---|---|
int |
getHeight()
Gets the height of the Matrix
|
T |
getValue(int x,
int y)
Returns the value contained by the cell of the Matrix at (x, y)
|
int |
getWidth()
Gets the width of the Matrix
|
void |
setValue(int x,
int y,
T value)
Changes the value contained by the cell of the Matrix at (x, y), returns
null if the position doesn't exists
|
public SimpleMatrix(int width, int height)
width
- Width of the Matrixheight
- Height of the MAtrixpublic SimpleMatrix(int width, int height, T value)
width
- Width of the Matrixheight
- Height of the MAtrixvalue
- Value that should be put in every cellpublic SimpleMatrix(Matrix<T> matrix)
matrix
- Matrix to copypublic T getValue(int x, int y)
Matrix
public void setValue(int x, int y, T value)
Matrix
public int getHeight()
Matrix