org.simulator.math.odes
Class MultiTable.Block

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.simulator.math.odes.MultiTable.Block
All Implemented Interfaces:
Serializable, TableModel
Enclosing class:
MultiTable

public class MultiTable.Block
extends AbstractTableModel

A MultiTable.Block is a data structure with a two-dimensional double array of actual data together with identifiers for each column.

Author:
Andreas Dräger
See Also:
Serialized Form

Nested Class Summary
 class MultiTable.Block.Column
          A column of the MultiTable.Block matrix.
 
Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Method Summary
 boolean containsColumn(String id)
          Checks whether or not this MultiTable.Block contains a MultiTable.Block.Column with the given identifier.
 MultiTable.Block.Column getColumn(int columnIndex)
          Grants access to the specified column.
 MultiTable.Block.Column getColumn(String identfier)
          Provides access to the MultiTable.Block.Column corresponding to the given identifier.
 int getColumnCount()
           
 String getColumnIdentifier(int column)
           
 String getColumnName(int column)
           
 String[] getColumnNames()
           
 double[][] getData()
           
 String[] getIdentifiers()
           
 String getName()
           
 double[] getRow(int rowIndex)
          Delivers the given row of the data matrix as an array of doubles only, i.e., no time points.
 int getRowCount()
           
 double[] getTimePoints()
          Access to the time points of the overall table.
 Double getValueAt(int rowIndex, int columnIndex)
           
 boolean isSetData()
          Checks whether or not a data matrix has been defined in this object
 void setColumnNames(String[] columnNames)
           
 void setData(double[][] data)
           
 void setIdentifiers(String[] identifiers)
           
 void setName(String name)
           
 void setRowData(int rowIndex, double[] array)
          Sets the given array as the new row in the given position of the data matrix, but requires that the number of values in the array equal the number of columns in the matrix.
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 String toString()
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

containsColumn

public boolean containsColumn(String id)
Checks whether or not this MultiTable.Block contains a MultiTable.Block.Column with the given identifier.

Parameters:
id -
Returns:
containsColumn?

getColumn

public MultiTable.Block.Column getColumn(int columnIndex)
Grants access to the specified column.

Parameters:
columnIndex - The index of the column (excluding the time column)
Returns:
Returns the MultiTable.Block.Column with the given index in the data matrix, i.e., the time column is excluded.

getColumn

public MultiTable.Block.Column getColumn(String identfier)
Provides access to the MultiTable.Block.Column corresponding to the given identifier.

Parameters:
identfier - The identifier of the MultiTable.Block.Column to be queried.
Returns:
A MultiTable.Block.Column object for convenient access to the data in the desired table column.

getColumnCount

public int getColumnCount()

getColumnIdentifier

public String getColumnIdentifier(int column)
Parameters:
column -
Returns:
identifier

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

getColumnNames

public String[] getColumnNames()
Returns:
the columnNames

getData

public double[][] getData()
Returns:
the data

getIdentifiers

public String[] getIdentifiers()
Returns:
the identifiers

getName

public String getName()
Returns:
blockName

getRow

public double[] getRow(int rowIndex)
Delivers the given row of the data matrix as an array of doubles only, i.e., no time points.

Parameters:
rowIndex - The index of the row to be delivered.
Returns:
An array of double values from the encapsulated data matrix.

getRowCount

public int getRowCount()

getTimePoints

public double[] getTimePoints()
Access to the time points of the overall table.

Returns:
A pointer to the time points in the containing table.

getValueAt

public Double getValueAt(int rowIndex,
                         int columnIndex)

isSetData

public boolean isSetData()
Checks whether or not a data matrix has been defined in this object

Returns:
dataSet?

setColumnNames

public void setColumnNames(String[] columnNames)
Parameters:
columnNames - the columnNames to set

setData

public void setData(double[][] data)
Parameters:
data - the data to set

setIdentifiers

public void setIdentifiers(String[] identifiers)
Parameters:
identifiers - the identifiers to set

setName

public void setName(String name)
Parameters:
name -

setRowData

public void setRowData(int rowIndex,
                       double[] array)
Sets the given array as the new row in the given position of the data matrix, but requires that the number of values in the array equal the number of columns in the matrix.

Parameters:
rowIndex - The index of the row to be replaced by the new array.
array - An array of length getColumnCount() - 1.

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel

toString

public String toString()
Overrides:
toString in class Object

Generated December 13 2012