|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.jstatcom.ts.TSTableModel
public final class TSTableModel
A table model to be used with the TSTable component for
representing merged time series data. The model takes an array of time series
with possibly different time ranges but equal sub periodicities and merges
the series to a common time range, which includes all ranges.
| Constructor Summary | |
|---|---|
TSTableModel()
TSTableModel default constructor. |
|
| Method Summary | |
|---|---|
int[] |
findRowIndexOf(java.lang.Double val,
int startIndex)
Finds the index of the row, where the given Double value
appears first, starting from a given row index. |
java.lang.Class<java.lang.String> |
getColumnClass(int col)
Gets column class. |
int |
getColumnCount()
Gets number of displayed TS. |
java.lang.String |
getColumnName(int col)
Gets the name of the TS displayed in a certain column. |
double |
getDoubleValueAt(int row,
int col)
Gets underlying observation for a given row and column as a double value. |
int |
getRowCount()
Gets number of displayed observations in time range of all TS. |
javax.swing.JViewport |
getRowHeader(javax.swing.JTable table)
Gets a JViewport that can be used as row header for a
scrollpane. |
TSDate |
getStartTSDate()
Gets the TSDate where the very first observation in the
model occurs. |
java.lang.Object |
getValueAt(int row,
int col)
Gets underlying observation for a given row and column. |
boolean |
isCellEditable(int row,
int col)
Gets whether given cell can be edited. |
void |
setTS(TS[] tsArray)
Sets the TS to be held by the model. |
void |
setValueAt(java.lang.Object obj,
int row,
int col)
Sets data at a given position and displays an error message if input cannot be parsed to a double. |
| 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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TSTableModel()
TSTableModel default constructor.
| Method Detail |
|---|
public int[] findRowIndexOf(java.lang.Double val,
int startIndex)
Double value
appears first, starting from a given row index. It also gives back the
row with the closest match for val. In case of an exact
match, both values are the same. In case of no exact match, the first
value is -1 and the second the index of the row containing
the value that is closest to val.
val - the value to search forstartIndex - index to start from, if out of range start from 0
int[0] row index of 1st exact match or
-1 if no exact match or if
val == null
int[1] row index of closest match or
-1 if val == null
java.lang.IllegalStateException - if (getRowCount() == 0)public java.lang.Class<java.lang.String> getColumnClass(int col)
String.class,
to make sure that the string editor is choosen.
getColumnClass in interface javax.swing.table.TableModelgetColumnClass in class javax.swing.table.AbstractTableModelcol - does not matter
public int getColumnCount()
TS.
public java.lang.String getColumnName(int col)
TS displayed in a certain column.
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModelcol - column index
public double getDoubleValueAt(int row,
int col)
double value.
public int getRowCount()
TS.
public javax.swing.JViewport getRowHeader(javax.swing.JTable table)
JViewport that can be used as row header for a
scrollpane. This contains the time axis that can be shown with the table
together with an index for the current row. Use the method with the
JScrollPane that encloses a TSTable using
this model.
table - the JTable to synchronize selection with
JScrollPanepublic TSDate getStartTSDate()
TSDate where the very first observation in the
model occurs.
public java.lang.Object getValueAt(int row,
int col)
row - index for rowcol - index for column
public boolean isCellEditable(int row,
int col)
editable property.
isCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModelrow - index for rowcol - index for column
public void setTS(TS[] tsArray)
TS to be held by the model. It merges the series
and creates the data and names arrays.
tsArray - an array of TS objects with the same sub
periodicity
public void setValueAt(java.lang.Object obj,
int row,
int col)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelobj - Object that the method tries to parse to a Doublerow - index for rowcol - index for column
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||