|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.hawaii.ics.yucheng.Matrix<T>
T
- The type stored as matrix elements.class Matrix<T>
A generic matrix class.
Field Summary | |
---|---|
private java.util.ArrayList<T> |
myArray
|
private int |
myColumns
|
private int |
myRows
|
Constructor Summary | |
---|---|
|
Matrix(int rows,
int columns,
T defaultValue)
Initializes a new instance of the class. |
protected |
Matrix(Matrix<T> matrix)
Clones a matrix. |
Method Summary | |
---|---|
Matrix<T> |
clone()
Returns a clone of the matrix. |
int |
columns()
Returns the number of columns. |
T |
get(int row,
int column)
Returns the element value at a specified position. |
int |
rows()
Returns the number of rows. |
void |
set(int row,
int column,
T value)
Sets the element value at the specified position. |
java.lang.String |
toString()
Returns the string representation of the class. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final java.util.ArrayList<T> myArray
private final int myColumns
private final int myRows
Constructor Detail |
---|
public Matrix(int rows, int columns, T defaultValue)
rows
- The number of rows.columns
- The number of columns.defaultValue
- The default value.protected Matrix(Matrix<T> matrix)
matrix
- The matrix to clone.Method Detail |
---|
public Matrix<T> clone()
clone
in class java.lang.Object
public int columns()
public T get(int row, int column)
row
- The row.column
- The column.
public int rows()
public void set(int row, int column, T value)
row
- The row.column
- The column.value
- The value.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |