|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.simulator.math.odes.MultiTable
public class MultiTable
This data structure contains the an array of sorted time points and a matrix organized in one column per quantity for which data (measurement or simulation) are gathered. Each row in the matrix corresponds to one time point. Hence, the array of time points must be equal to the number of rows in the matrix. To be able to identify the content of each column, this data structure also contains an array of identifiers for each column.
To be displayed in a graphical user interface, this object extends
AbstractTableModel
. Note that the access to the elements in this
object therefore puts both elements together, i.e., the time column is
considered to be the first column in the table.
Nested Class Summary | |
---|---|
class |
MultiTable.Block
A MultiTable.Block is a data structure with a two-dimensional double array
of actual data together with identifiers for each column. |
Field Summary |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
MultiTable()
Constructs an empty MultiTable object. |
|
MultiTable(double[] timePoints,
double[][] data,
String[] identifiers)
Constructs a data object for the given values. |
|
MultiTable(double[] timePoints,
double[][] data,
String[] columnIdentifiers,
String[] columnNames)
|
Method Summary | |
---|---|
void |
addBlock(String[] identifiers)
Creates a new MultiTable.Block and adds it to this object. |
MultiTable |
filter(double[] timepoints)
Creates a multi block table only containing the values for the given timepoints (if available) |
MultiTable.Block |
getBlock(int index)
|
int |
getBlockCount()
|
MultiTable.Block.Column |
getColumn(int column)
|
MultiTable.Block.Column |
getColumn(String identifier)
Returns the column corresponding to the given identifier. |
Class<Double> |
getColumnClass(int columnIndex)
|
int |
getColumnCount()
|
String |
getColumnIdentifier(int column)
|
int |
getColumnIndex(String identifier)
Returns the index of a column for a given identifier. |
String |
getColumnName(int column)
|
String |
getName()
Gives this MultiTable 's name. |
int |
getNumBlocks()
|
int |
getRowCount()
|
static long |
getSerialversionuid()
|
String |
getTimeName()
The column identifier for the first column, i.e., the time column. |
double |
getTimePoint(int rowIndex)
Returns the time value at the given index position. |
double[] |
getTimePoints()
|
Double |
getValueAt(int rowIndex,
int columnIndex)
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
|
boolean |
isSetTimePoints()
Checks whether an array of time points has been set for this object. |
Iterator<Iterable<Double>> |
iterator()
|
void |
removeBlock(int index)
Removes the MultiTable.Block with the given index from this data structure. |
void |
setName(String name)
Sets the name of this MultiTable . |
void |
setTimeName(String timeName)
Set the name of the time column |
void |
setTimePoints(double[] timePoints)
|
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, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultiTable()
MultiTable
object.
public MultiTable(double[] timePoints, double[][] data, String[] identifiers)
timePoints
- data
- identifiers
- The first column in identifiers may be the name for the time
column.public MultiTable(double[] timePoints, double[][] data, String[] columnIdentifiers, String[] columnNames)
timePoints
- data
- columnIdentifiers
- columnNames
- Method Detail |
---|
public static long getSerialversionuid()
public void addBlock(String[] identifiers)
MultiTable.Block
and adds it to this object.
The number of rows will be equal to the number of time points of the
overall data structure.
identifiers
- The column identifiers of the new block.public MultiTable filter(double[] timepoints)
timepoints
-
public MultiTable.Block getBlock(int index)
index
-
public int getBlockCount()
public MultiTable.Block.Column getColumn(int column)
column
-
public MultiTable.Block.Column getColumn(String identifier)
identifier
- An identifier.
MultiTable.Block.Column
object for this identifier or null if no such
MultiTable.Block.Column
exists.public int getColumnIndex(String identifier)
identifier
-
public Class<Double> getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public String getColumnIdentifier(int column)
column
-
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public String getName()
MultiTable
's name.
public int getNumBlocks()
public int getRowCount()
getRowCount
in interface TableModel
public String getTimeName()
public double getTimePoint(int rowIndex)
rowIndex
- The index of the time value of interest.
public double[] getTimePoints()
public Double getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public boolean isSetTimePoints()
public Iterator<Iterable<Double>> iterator()
iterator
in interface Iterable<Iterable<Double>>
public void removeBlock(int index)
MultiTable.Block
with the given index from this data structure.
index
- The index of the block. Do not confuse with the index of the
column.public void setName(String name)
MultiTable
.
name
- public void setTimeName(String timeName)
timeName
- the timeName to setpublic void setTimePoints(double[] timePoints)
timePoints
- the timePoints to setpublic void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public String toString()
toString
in class Object
|
Generated December 13 2012 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |