|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
R
- the row index type.C
- the column index type.E
- the element type.public interface Matrix<R,C,E>
This interface is used to represent matrices. A matrix is
composed of rows and columns, which are referred to by
their corresponding indices. Typically these indices are
integer values from 1 to m and n, where
m is the number of rows and n is the number
of columns. In this matrix representation, however, indices
can be any type of Object
. Indices are compared
via their Object.equals(Object) method.
Method Summary | |
---|---|
int |
columns()
Returns the number of columns in this matrix. |
boolean |
equals(java.lang.Object obj)
Indicates if the provided object is equal to this matrix. |
Matrix<R,C,E> |
getColumn(java.lang.Object columnIndex)
Returns the column corresponding to the provided column index. |
java.util.Set<C> |
getColumnIndices()
Returns the set of column indices contained in this matrix. |
E |
getElement(java.lang.Object rowIndex,
java.lang.Object columnIndex)
Returns the element of this matrix at the provided row and column indices. |
Matrix<R,C,E> |
getRow(java.lang.Object rowIndex)
Returns the row corresponding to the provided row index. |
java.util.Set<R> |
getRowIndices()
Returns the set of row indices contained in this matrix. |
int |
hashCode()
Returns a content-based hash code for this matrix. |
boolean |
isColumnIndex(java.lang.Object obj)
Indicates if the provided object is a column index in this matrix. |
boolean |
isEmpty()
Indicates if this matrix is empty. |
boolean |
isRowIndex(java.lang.Object obj)
Indicates if the provided object is a row index in this matrix. |
int |
rows()
Returns the number of rows in this matrix. |
java.lang.String |
toString()
Returns a string representation of this matrix. |
Method Detail |
---|
E getElement(java.lang.Object rowIndex, java.lang.Object columnIndex)
rowIndex
- the row index.columnIndex
- the column index.
java.util.Set<C> getColumnIndices()
java.util.Set<R> getRowIndices()
boolean isRowIndex(java.lang.Object obj)
obj
- the potential row index.
true
if the provided object is a row
index in this matrix; false
otherwise.boolean isColumnIndex(java.lang.Object obj)
obj
- the potential column index.
true
if the provided object is a column
index in this matrix; false
otherwise.Matrix<R,C,E> getRow(java.lang.Object rowIndex)
rowIndex
- the index of the row to be returned.
Matrix<R,C,E> getColumn(java.lang.Object columnIndex)
columnIndex
- the index of the column to be returned.
int rows()
int columns()
boolean isEmpty()
true
if at least one row and column exists
in this matrix; false
otherwise.java.lang.String toString()
toString
in class java.lang.Object
boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object with which to compare.
true
if this object equals the provided
object; false
otherwise.int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |