www.sdmetrics.com

com.sdmetrics.app
Class RelationMatrices

java.lang.Object
  extended by com.sdmetrics.app.RelationMatrices
All Implemented Interfaces:
DataTables

public class RelationMatrices
extends java.lang.Object
implements DataTables

Calculates all relation matrices and provides a tabular view of their contents.

Creates one table for each relation matrix. Rows are the source design elements from which the relationship originates, columns are the target design elements of the relationship. The class hides empty matrices. A matrix is empty if there are no source or target elements, or if it is a null matrix.


Constructor Summary
RelationMatrices(MatrixEngine engine)
           
 
Method Summary
 boolean calculateMatrices(MessageHandler msgHandler, int startPercent, int finishPercent)
          Calculates all relation matrices, reports any errors.
 java.lang.String getColumnDescription(int index, int col)
          Returns a short description of a column.
 java.lang.String getColumnName(int index, int col)
          Gets the name of a target element in specific column.
 int getNumberOfColumns(int index)
          Gets the number of target design elements (columns) in a table.
 int getNumberOfRows(int index)
          Gets the number of source design elements (rows) in a table.
 int getNumberOfTables()
          Returns the number of available tables.
 java.lang.String getRowName(int index, int row)
          Gets the name of a source element in specific row.
 java.lang.String getTableName(int index)
          Returns the name of the relation matrix.
 java.lang.String getTablesDescription()
          Returns a short description of the tables contents.
 java.lang.String getTypeName(int index)
          Returns the metamodel type name of the elements of a table.
 java.lang.Object getValueAt(int index, int row, int col)
          Returns the value of a table cell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationMatrices

public RelationMatrices(MatrixEngine engine)
Parameters:
engine - The relation matrices to calculate and display.
Method Detail

calculateMatrices

public boolean calculateMatrices(MessageHandler msgHandler,
                                 int startPercent,
                                 int finishPercent)
Calculates all relation matrices, reports any errors.

Parameters:
msgHandler - Handler for progress and error messages
startPercent - Initial value of the progress indicator
finishPercent - Value of the progress indicator at the completion of this calculation run
Returns:
true if the matrices were calculated without errors, false if an error occurred.

getNumberOfTables

public int getNumberOfTables()
Description copied from interface: DataTables
Returns the number of available tables.

Specified by:
getNumberOfTables in interface DataTables
Returns:
The number of tables, n. Valid table indices run from 0 to n-1.

getTableName

public java.lang.String getTableName(int index)
Returns the name of the relation matrix.

Specified by:
getTableName in interface DataTables
Parameters:
index - Index of the table to access.
Returns:
The name of that table.

getNumberOfRows

public int getNumberOfRows(int index)
Gets the number of source design elements (rows) in a table.

Specified by:
getNumberOfRows in interface DataTables
Parameters:
index - Index of the table to access.
Returns:
The number of rows of the table, r. Valid row indices for the table run from 0 to r-1.

getNumberOfColumns

public int getNumberOfColumns(int index)
Gets the number of target design elements (columns) in a table.

Specified by:
getNumberOfColumns in interface DataTables
Parameters:
index - Index of the table to access.
Returns:
Number of columns of the table, c. Valid column indices for the table run from 0 to c-1.

getValueAt

public java.lang.Object getValueAt(int index,
                                   int row,
                                   int col)
Description copied from interface: DataTables
Returns the value of a table cell.

Specified by:
getValueAt in interface DataTables
Parameters:
index - Index of the table to access.
row - Index of the row to access.
col - Index of the column to access.
Returns:
Table cell value at the specified coordinates.

getRowName

public java.lang.String getRowName(int index,
                                   int row)
Gets the name of a source element in specific row.

Specified by:
getRowName in interface DataTables
Parameters:
index - Index of the table to access.
row - Index of the row to access.
Returns:
The name of the row to be used as row header.

getColumnName

public java.lang.String getColumnName(int index,
                                      int col)
Gets the name of a target element in specific column.

Specified by:
getColumnName in interface DataTables
Parameters:
index - Index of the table to access.
col - Index of the column to access.
Returns:
The name of the column to be used as column header.

getColumnDescription

public java.lang.String getColumnDescription(int index,
                                             int col)
Description copied from interface: DataTables
Returns a short description of a column. The description is a short string (one-liner), providing a brief, informal description of the column, and can be used, e.g., as a tool tip for the column headers when displaying the table on screen.

Specified by:
getColumnDescription in interface DataTables
Parameters:
index - Index of the table to access.
col - Index of the column to access.
Returns:
Empty string - columns of relation matrices have no description.

getTablesDescription

public java.lang.String getTablesDescription()
Description copied from interface: DataTables
Returns a short description of the tables contents. For example, "metric data", "design rule violations", "descriptive statistics", etc.

Specified by:
getTablesDescription in interface DataTables
Returns:
Description of the table contents.

getTypeName

public java.lang.String getTypeName(int index)
Description copied from interface: DataTables
Returns the metamodel type name of the elements of a table.

Specified by:
getTypeName in interface DataTables
Parameters:
index - Index of the table to access.
Returns:
Empty string - not applicable for relation matrices

www.sdmetrics.com