org.pentaho.reporting.engine.classic.core.states
Class LengthLimitingTableModel

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.states.LengthLimitingTableModel
All Implemented Interfaces:
TableModel, MetaTableModel

public class LengthLimitingTableModel
extends Object
implements MetaTableModel

Todo: Document Me

Author:
Thomas Morgner

Constructor Summary
LengthLimitingTableModel(TableModel backend, int queryLimit)
           
 
Method Summary
 void addTableModelListener(TableModelListener l)
           
 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 columnIndex)
           
 int getRowCount()
           
 DataAttributes getTableAttributes()
          Returns table-wide attributes.
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellDataAttributesSupported()
          Checks, whether cell-data attributes are supported by this tablemodel implementation.
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 void removeTableModelListener(TableModelListener l)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LengthLimitingTableModel

public LengthLimitingTableModel(TableModel backend,
                                int queryLimit)
Method Detail

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int columnIndex)
Specified by:
getColumnName in interface TableModel

getColumnClass

public Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

setValueAt

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

addTableModelListener

public void addTableModelListener(TableModelListener l)
Specified by:
addTableModelListener in interface TableModel

removeTableModelListener

public void removeTableModelListener(TableModelListener l)
Specified by:
removeTableModelListener in interface TableModel

getCellDataAttributes

public DataAttributes getCellDataAttributes(int row,
                                            int column)
Returns the meta-attribute as Java-Object. The object type that is expected by the report engine 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.

Meta-data models that only describe meta-data for columns can ignore the row-parameter.

Specified by:
getCellDataAttributes in interface MetaTableModel
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 interface MetaTableModel
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 interface MetaTableModel
Parameters:
column - the column.
Returns:
data-attributes, never null.

getTableAttributes

public DataAttributes getTableAttributes()
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 interface MetaTableModel
Returns: