|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.table.data.AbstractDataSource | +--com.klg.jclass.table.data.AbstractVectorDataSource | +--com.klg.jclass.table.data.JCCachedDataSource
The JCCachedDataSource
class stores data in a Vector of Vectors.
Unlike other data sources, the source for label and cell data is another
TableData
class. If the object stored for the cell or label
is null, the call passes through to the contained TableData
class, and the value is fetched and stored in JCCachedDataSource
.
JCCachedDataSource
should only be used when the actual
TableData
's getTableDataItem
, getTableRowLabel
,
or getTableColumnLabel
are calculation-intensive or expensive to fetch.
Although JCCachedDataSource
can bind to any data source, it
implements TableData
and not EditableTableData
,
and is therefore not editable. Use EditableCachedDataSource
to bind to an editable data source and have edit functionality.
Note:
A non-editable data source bound to JCEditableCachedDataSource
will display an editor but reject all changes.
com.sun.java.util
class.Field Summary | |
protected Vector |
cached_cells
|
protected Vector |
cached_column_labels
|
protected Vector |
cached_row_labels
|
protected com.klg.jclass.table.TableDataModel |
dataSource
The actual source of data. |
Fields inherited from class com.klg.jclass.table.data.AbstractDataSource |
listeners |
Constructor Summary | |
JCCachedDataSource(com.klg.jclass.table.TableDataModel source)
Creates a new TableDataModel caching data source. |
Method Summary | |
void |
dataChanged(com.klg.jclass.table.JCTableDataEvent e)
Listens for JCTableDataEvents on the contained data source. |
int |
getNumColumns()
Returns the number of columns in the contained data source. |
int |
getNumRows()
Returns the number of rows in the contained data source. |
Object |
getTableColumnLabel(int column)
Returns the value for the column label at the specified column. |
Object |
getTableDataItem(int row,
int column)
Returns the value for the cell at the specified location. |
Object |
getTableRowLabel(int row)
Returns the value for the row label at the specified row. |
Methods inherited from class com.klg.jclass.table.data.AbstractVectorDataSource |
createVector, createVector, createVector, createVector, createVector, removeElementsAt, setElementAt, strip |
Methods inherited from class com.klg.jclass.table.data.AbstractDataSource |
addTableDataListener, dispose, fireColumnChanged, fireColumnLabelChanged, fireColumnsAdded, fireColumnsDeleted, fireColumnsMoved, fireDataReset, fireNumColumnsChanged, fireNumRowsChanged, fireRowChanged, fireRowDeleted, fireRowLabelChanged, fireRowsAdded, fireRowsMoved, fireTableDataEvent, fireValueChanged, hasListeners, removeTableDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected com.klg.jclass.table.TableDataModel dataSource
protected Vector cached_row_labels
protected Vector cached_column_labels
protected Vector cached_cells
Constructor Detail |
public JCCachedDataSource(com.klg.jclass.table.TableDataModel source)
TableDataModel
caching data source.
source
- Method Detail |
public int getNumRows()
getNumRows
in interface JCTableDataModel
public int getNumColumns()
getNumColumns
in interface JCTableDataModel
public Object getTableDataItem(int row, int column)
getTableDataItem
in interface JCTableDataModel
row
- column
-
public Object getTableRowLabel(int row)
getTableRowLabel
in interface JCTableDataModel
row
-
public Object getTableColumnLabel(int column)
getTableColumnLabel
in interface JCTableDataModel
column
-
public void dataChanged(com.klg.jclass.table.JCTableDataEvent e)
JCTableDataEvents
on the contained data source. A simplistic approach has
been taken to dirty the cache. For single cell changes, the element is set to
null so that the next read forces a re-read of the contained data source. For
row specific changes, the row and cell cache is nulled; for column specific
changes, the column and cell cache is nulled. Reset nulls everything.
dataChanged
in interface JCTableDataListener
e
-
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |