org.pentaho.chart
Interface ChartData

All Superinterfaces:
TableModel
All Known Implementing Classes:
ChartTableModel

public interface ChartData
extends TableModel

The interface which defines the API for access into data used for charting.

Author:
David Kincade

Method Summary
 int findColumn(String columnName)
          Returns the 1st column index with the specified name
 int findRow(String rowName)
          Returns the 1st row number of the row which has the specified row name.
 Object getCellMetadata(int rowIndex, int colIndex, Object metadataKey)
          Retrieves the metadata for the specified cell and key
 Object getColMetadata(int colIndex, Object metadataKey)
          Retrieves the metadata for the specified column and key
 Object getRowMetadata(int rowIndex, Object metadataKey)
          Retrieves the metadata for the specified row and key
 String getRowName(int rowIndex)
          Retrieves the name assigned to the specified row
 void setCellMetadata(int rowIndex, int colIndex, Object metadataKey, Object metadataValue)
          Sets a piece of metadata for the specified cell.
 void setColMetadata(int colIndex, Object metadataKey, Object metadataValue)
          Sets a piece of metadata for the specified column.
 void setColumnName(int columnIndex, String columnName)
          Sets the name of the column in the charting data
 void setRowMetadata(int rowIndex, Object metadataKey, Object metadataValue)
          Sets a piece of metadata for the specified row.
 void setRowName(int rowIndex, String rowName)
          Sets the name of the row in the charting data
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Method Detail

setColumnName

void setColumnName(int columnIndex,
                   String columnName)
Sets the name of the column in the charting data

Parameters:
columnIndex - the index of the column whose name is being set
columnName - the name being assigned to the column

setRowName

void setRowName(int rowIndex,
                String rowName)
Sets the name of the row in the charting data

Parameters:
rowIndex - the index of the
rowName - the name being assigned to the row

getRowName

String getRowName(int rowIndex)
Retrieves the name assigned to the specified row

Parameters:
rowIndex - the index of the whose name should be retrieved
Returns:
the name assigned to the specified row, or null if none is assgined

setRowMetadata

void setRowMetadata(int rowIndex,
                    Object metadataKey,
                    Object metadataValue)
Sets a piece of metadata for the specified row. If the metadata key already exists for the specified row index, the existing metadata value will be replaced with the new value provided.

Parameters:
rowIndex - the index of the row
metadataKey - the key for the metadata being set
metadataValue - the value of the metadata being set (a value of null will remove any existing metadata value for the specified metadataKey for the specified row)

setColMetadata

void setColMetadata(int colIndex,
                    Object metadataKey,
                    Object metadataValue)
Sets a piece of metadata for the specified column. If the metadata key already exists for the specified column index, the existing metadata value will be replaced with the new value provided.

Parameters:
colIndex - the index of the row
metadataKey - the key for the metadata being set
metadataValue - the value of the metadata being set (a value of null will remove any existing metadata value for the specified metadataKey for the specified column)

setCellMetadata

void setCellMetadata(int rowIndex,
                     int colIndex,
                     Object metadataKey,
                     Object metadataValue)
Sets a piece of metadata for the specified cell. If the metadata key already exists for the specified cell index, the existing metadata value will be replaced with the new value provided.

Parameters:
rowIndex - the row index of the cell
colIndex - the column index of the cell
metadataKey - the key for the metadata being set
metadataValue - the value of the metadata being set (a value of null will remove any existing metadata value for the specified metadataKey for the specified cell)

getRowMetadata

Object getRowMetadata(int rowIndex,
                      Object metadataKey)
Retrieves the metadata for the specified row and key

Parameters:
rowIndex - the row index
metadataKey - the metadata key
Returns:
the metadata value for the specified row and key. If there is no metadata value, null will be returned.

getColMetadata

Object getColMetadata(int colIndex,
                      Object metadataKey)
Retrieves the metadata for the specified column and key

Parameters:
colIndex - the row index
metadataKey - the metadata key
Returns:
the metadata value for the specified column and key. If there is no metadata value, null will be returned.

getCellMetadata

Object getCellMetadata(int rowIndex,
                       int colIndex,
                       Object metadataKey)
Retrieves the metadata for the specified cell and key

Parameters:
rowIndex - the row index of the cell
colIndex - the row index of the cell
metadataKey - the metadata key
Returns:
the metadata value for the specified cell and key. If there is no metadata value, null will be returned.

findColumn

int findColumn(String columnName)
Returns the 1st column index with the specified name

Parameters:
columnName - the name of the column
Returns:
the index of the 1st column with the specified name. If none can be found, this method will return -1.

findRow

int findRow(String rowName)
Returns the 1st row number of the row which has the specified row name.

Parameters:
rowName - the name of the row
Returns:
the row number of the 1st row with the specified name. If none can be found. this method will return -1.