Class CachableTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.pentaho.reporting.engine.classic.core.cache.CachableTableModel
-
- All Implemented Interfaces:
Serializable
,TableModel
,MetaTableModel
public class CachableTableModel extends AbstractTableModel implements MetaTableModel
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description CachableTableModel(TableModel model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DataAttributes
getCellDataAttributes(int row, int column)
Returns the meta-attribute as Java-Object.DataAttributes
getColumnAttributes(int column)
Returns the column-level attributes for the given column.Class
getColumnClass(int columnIndex)
int
getColumnCount()
String
getColumnName(int column)
int
getRowCount()
DataAttributes
getTableAttributes()
Returns table-wide attributes.Object
getValueAt(int rowIndex, int columnIndex)
protected void
initData(TableModel model)
protected void
initDefaultMetaData(TableModel model)
protected void
initFromMetaModel(MetaTableModel metaTableModel)
boolean
isCellDataAttributesSupported()
Checks, whether cell-data attributes are supported by this tablemodel implementation.static boolean
isSafeToCache(TableModel model)
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Constructor Detail
-
CachableTableModel
public CachableTableModel(TableModel model)
-
-
Method Detail
-
initFromMetaModel
protected void initFromMetaModel(MetaTableModel metaTableModel)
-
initData
protected void initData(TableModel model)
-
initDefaultMetaData
protected void initDefaultMetaData(TableModel model)
-
getColumnName
public String getColumnName(int column)
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getColumnClass
public Class getColumnClass(int columnIndex)
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
getCellDataAttributes
public DataAttributes getCellDataAttributes(int row, int column)
Description copied from interface:MetaTableModel
Returns the meta-attribute as Java-Object. The object type that is expected by the caller is defined in the TableMetaData property set. It is the responsibility of the implementor to map the native meta-data model into a model suitable for reporting. Be aware that cell-level attributes do not make it into the designtime dataschema, as this dataschema only looks at the structural metadata available and does not contain any data references.- Specified by:
getCellDataAttributes
in interfaceMetaTableModel
- Parameters:
row
- the row of the cell for which the meta-data is queried.column
- the index of the column for which the meta-data is queried.- Returns:
- the meta-data object.
-
isCellDataAttributesSupported
public boolean isCellDataAttributesSupported()
Description copied from interface:MetaTableModel
Checks, whether cell-data attributes are supported by this tablemodel implementation.- Specified by:
isCellDataAttributesSupported
in interfaceMetaTableModel
- Returns:
- true, if the model supports cell-level attributes, false otherwise.
-
getColumnAttributes
public DataAttributes getColumnAttributes(int column)
Description copied from interface:MetaTableModel
Returns the column-level attributes for the given column.- Specified by:
getColumnAttributes
in interfaceMetaTableModel
- Parameters:
column
- the column.- Returns:
- data-attributes, never null.
-
getTableAttributes
public DataAttributes getTableAttributes()
Description copied from interface:MetaTableModel
Returns table-wide attributes. This usually contain hints about the data-source used to query the data as well as hints on the sort-order of the data.- Specified by:
getTableAttributes
in interfaceMetaTableModel
- Returns:
- the table-attributes, never null.
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfaceTableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfaceTableModel
-
getValueAt
public Object getValueAt(int rowIndex, int columnIndex)
- Specified by:
getValueAt
in interfaceTableModel
-
isSafeToCache
public static boolean isSafeToCache(TableModel model)
-
-