www.sdmetrics.com

sdmetrics.app
Class MeasurementCatalog

java.lang.Object
  |
  +--sdmetrics.app.MeasurementCatalog
All Implemented Interfaces:
DataTable

public class MeasurementCatalog
extends java.lang.Object
implements DataTable

Provide the information of the measurement catalog. This includes the full descriptions for all metrics, rules, and matrices, and the literature references and glossary. The information is provided via the DataTable interface. For example, there is one data table named "Metrics" which contains all the metrics, one per row, where the columns contain additional information, such as the domain, category, and short definitions of the metrics. Likewise, there is one table each for rules, matrices, literature references and the glossary.


Constructor Summary
MeasurementCatalog(sdmetrics.metrics.MetricStore ms)
           
 
Method Summary
 java.lang.String getColumnDescription(int index, int col)
          Return a short description of a column.
 java.lang.String getColumnName(int index, int col)
          Return the name of the object a column represents (column header).
 java.lang.String getDescriptionHeader(int table, int row)
          Get the description header of an object in the catalog.
 java.lang.String getFullDescription(int table, int row)
          Get the full description of an object in the catalog.
 java.lang.String getLocatorForMatrix(java.lang.String name)
          Get the locator string for a matrix.
 java.lang.String getLocatorForMetric(int type, java.lang.String name)
          Get the locator string for a metric.
 java.lang.String getLocatorForRule(int type, java.lang.String name)
          Get the locator string for a rule.
 sdmetrics.metrics.MetricStore getMetricStore()
          Get the metric store on which this measurement catalog is based.
 int getNumberOfColumns(int index)
          Return the number of columns in a table.
 int getNumberOfRows(int index)
          Return the number of rows in a table.
 int getNumberOfTables()
          Returns the number of available tables.
 int getRow(java.lang.String s)
          Get the row number of an object specified by the locator string.
 java.lang.String getRowName(int index, int row)
          Return the name of the object a row represents (row header).
 int getTable(java.lang.String s)
          Get the table with the objects that a locator refers to.
 java.lang.String getTableName(int index)
          Returns the name of a table.
 int getTypeID(int index)
          This method is not applicable for the measurement catalog.
 java.lang.Object getValueAt(int index, int row, int col)
          Return the table cell value at a particular coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeasurementCatalog

public MeasurementCatalog(sdmetrics.metrics.MetricStore ms)
Parameters:
ms - Metric Store with the contents of the metric definition file to display.
Method Detail

getMetricStore

public sdmetrics.metrics.MetricStore getMetricStore()
Get the metric store on which this measurement catalog is based.

Returns:
Metric store of this catalog.

getFullDescription

public java.lang.String getFullDescription(int table,
                                           int row)
Get the full description of an object in the catalog.

Parameters:
table - Index of the table to access.
row - Index of the object's row.
Returns:
String with the full description of the object.

getDescriptionHeader

public java.lang.String getDescriptionHeader(int table,
                                             int row)
Get the description header of an object in the catalog. The description header precedes the full description and typically displays some canonical information about the object. The description header may also be empty for some types of objects.

Parameters:
table - Index of the table to access.
row - Index of the object's row.
Returns:
String with the description header of the object.

getTable

public int getTable(java.lang.String s)
Get the table with the objects that a locator refers to.

Parameters:
s - A locator string, e.g., "matrix://Associations/".
Returns:
Index of the table that contains the object specified by the locator (e.g. index of the "Matrices" table), or -1 if there is no such table available.
See Also:
getRow(java.lang.String)

getRow

public int getRow(java.lang.String s)
Get the row number of an object specified by the locator string.

Parameters:
s - A locator string, e.g., "matrix://Associations/".
Returns:
Row index of the specified object in its table, or -1 if there is no such object.
See Also:
getTable(java.lang.String)

getLocatorForMetric

public java.lang.String getLocatorForMetric(int type,
                                            java.lang.String name)
Get the locator string for a metric.

Parameters:
type - Metamodel type ID of the metric's domain.
name - The name of the metric.
Returns:
Locator string of the form metric://typename/metricname/ for the metric.

getLocatorForRule

public java.lang.String getLocatorForRule(int type,
                                          java.lang.String name)
Get the locator string for a rule.

Parameters:
type - Metamodel type ID of the rule's domain.
name - The name of the rule.
Returns:
Locator string of the form rule://typename/rulename/ for the rule.

getLocatorForMatrix

public java.lang.String getLocatorForMatrix(java.lang.String name)
Get the locator string for a matrix.

Parameters:
name - The name of the matrix.
Returns:
Locator string of the form matrix://name/ for the matrix.

getNumberOfTables

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

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

getTableName

public java.lang.String getTableName(int index)
Description copied from interface: DataTable
Returns the name of a table.

Specified by:
getTableName in interface DataTable
Parameters:
index - Index of the table to access.
Returns:
String with the name of the table.

getNumberOfRows

public int getNumberOfRows(int index)
Description copied from interface: DataTable
Return the number of rows in a table. Note: This does NOT include the column header row with the column names.

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

getNumberOfColumns

public int getNumberOfColumns(int index)
Description copied from interface: DataTable
Return the number of columns in a table. Note: This does NOT include the column with the row headers (names).

Specified by:
getNumberOfColumns in interface DataTable
Parameters:
index - Index of the table to access.
Returns:
Number of columns in 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: DataTable
Return the table cell value at a particular coordinate.

Specified by:
getValueAt in interface DataTable
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)
Description copied from interface: DataTable
Return the name of the object a row represents (row header).

Specified by:
getRowName in interface DataTable
Parameters:
index - Index of the table to access.
row - Index of the row.
Returns:
The name of the row.

getColumnName

public java.lang.String getColumnName(int index,
                                      int col)
Description copied from interface: DataTable
Return the name of the object a column represents (column header).

Specified by:
getColumnName in interface DataTable
Parameters:
index - Index of the table to access.
col - Index of the column.
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: DataTable
Return 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 DataTable
Parameters:
index - Index of the table to access.
col - Index of the column.
Returns:
String with an informal description of the column.

getTypeID

public int getTypeID(int index)
This method is not applicable for the measurement catalog.

Specified by:
getTypeID in interface DataTable
Parameters:
index - Index of the table to access.
Returns:
0

www.sdmetrics.com