|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface provides methods for accessing and modifying matrices holding Objects. Most algorithms that do numerical computation work only with matrices. It is convenient to keep meta-data pertaining to a matrix element along with the element, however this can cause considerable slow-down of the code since everytime an element is accessed, the entire object representing that element must be loaded into the cache along with the numerical value which is really the most important thing. Implementations wishing to hold additional data about a matrix along with the element itself should use ObjectMatrixModel. The utility of this data model lies in the fact that for many visualization algorithms, the computation that decides the layout, etc is usually numerical, whereas the attributes that actually influence the look and feel of the data are complex types. Hence, using the DoubleMatrixModel and the ObjectMatrixModel allows, for example for an application to do all the computation using the fast DoubleMatrixModel and hold other attributes such as Color, Font, etc in ObjectMatrixModel. Note that the interface does not force any sort of bounds checking. This is an implementation detail and it is encouraged that implementations of ObjectMatrixModel do the required bounds-checking. Certain high-performance code does not do any bounds-checking in order to speed up the computation process and this is allowed, but discouraged.
DoubleMatrixModel| Method Summary | |
java.lang.Object |
get(int row,
int col)
Gets the element at the specified row and column. |
java.lang.String |
getColumnLabel(int col)
Gets the label for the specified column. |
int |
getNumberOfColumns()
|
int |
getNumberOfRows()
|
java.lang.String |
getRowLabel(int row)
Gets the label for the specified row. |
void |
set(int row,
int col,
java.lang.Object value)
Sets the value of the element at the specified row and column. |
void |
setColumnLabel(int col,
java.lang.String text)
Sets the label at the specified column to the specified text. |
void |
setRowLabel(int row,
java.lang.String text)
Sets the label of the specified row to the specified text. |
| Method Detail |
public java.lang.Object get(int row,
int col)
row - The row number of this element.col - The column number of this element.
public void set(int row,
int col,
java.lang.Object value)
row - The row number.col - The column number.value - The value of the element.
public void setColumnLabel(int col,
java.lang.String text)
col - The column number.text - The text of the label.public java.lang.String getColumnLabel(int col)
col - The column number.
public void setRowLabel(int row,
java.lang.String text)
row - The row number.text - The text of the label.public java.lang.String getRowLabel(int row)
row - The row number.
public int getNumberOfRows()
public int getNumberOfColumns()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||