public class Matrix<E>
extends java.lang.Object
Constructor and Description |
---|
Matrix(int rows, int cols, java.lang.Class<E> clazz)
Constructs an empty matrix with the specified dimensions.
|
Modifier and Type | Method and Description |
---|---|
E |
get(int row, int col)
Returns the element at the specified row and column.
|
E[] |
getColumn(int col) |
int |
getColumnDimension()
Returns the column dimension.
|
E[] |
getRow(int row) |
int |
getRowDimension()
Returns the row dimension.
|
void |
set(int row, int col, E elem)
Sets the element at the specified row and column.
|
public Matrix(int rows, int cols, java.lang.Class<E> clazz)
rows
- row dimensioncols
- column dimensionpublic int getColumnDimension()
public int getRowDimension()
public E get(int row, int col)
row
- row of the elementcol
- column of the elementpublic void set(int row, int col, E elem)
row
- row of the elementcol
- column of the elementelem
- elementpublic E[] getRow(int row)
public E[] getColumn(int col)