edu.iu.iv.core.datamodels.matrixmodel
Interface ObjectMatrixModel

All Known Implementing Classes:
DenseObjectMatrixModel, SparseObjectMatrixModel

public interface ObjectMatrixModel

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.

Version:
0.1
Author:
Team IVC
See Also:
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

get

public java.lang.Object get(int row,
                            int col)
Gets the element at the specified row and column.

Parameters:
row - The row number of this element.
col - The column number of this element.
Returns:
The value at matrix(row, column)

set

public void set(int row,
                int col,
                java.lang.Object value)
Sets the value of the element at the specified row and column.

Parameters:
row - The row number.
col - The column number.
value - The value of the element.

setColumnLabel

public void setColumnLabel(int col,
                           java.lang.String text)
Sets the label at the specified column to the specified text.

Parameters:
col - The column number.
text - The text of the label.

getColumnLabel

public java.lang.String getColumnLabel(int col)
Gets the label for the specified column.

Parameters:
col - The column number.
Returns:
The text of the label.

setRowLabel

public void setRowLabel(int row,
                        java.lang.String text)
Sets the label of the specified row to the specified text.

Parameters:
row - The row number.
text - The text of the label.

getRowLabel

public java.lang.String getRowLabel(int row)
Gets the label for the specified row.

Parameters:
row - The row number.
Returns:
The text of the label.

getNumberOfRows

public int getNumberOfRows()
Returns:
The number of rows in the matrix.

getNumberOfColumns

public int getNumberOfColumns()
Returns:
The number of columns in the matrix.