Class BandedMDXTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.pentaho.reporting.engine.classic.extensions.datasources.olap4j.BandedMDXTableModel
-
- All Implemented Interfaces:
Serializable
,TableModel
,org.pentaho.reporting.engine.classic.core.MetaTableModel
,org.pentaho.reporting.engine.classic.core.util.CloseableTableModel
public class BandedMDXTableModel extends AbstractTableModel implements org.pentaho.reporting.engine.classic.core.util.CloseableTableModel, org.pentaho.reporting.engine.classic.core.MetaTableModel
This tablemodel performs some preprocessing to get multi-dimensional resultset (with row and column headers) into a classical table-structure. The banded tablemodel wraps the column axis into columns of the tablemodel and maps all other axes into rows. Technically this is a hybrid between the legacy-banded-mdx model and the denormalized model. The column axis is computed similar to the legacy-banded model, while all other axes are simply denormalized.- Author:
- : Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description BandedMDXTableModel(QueryResultWrapper resultSet, int rowLimit)
Deprecated.BandedMDXTableModel(QueryResultWrapper resultWrapper, int rowLimit, boolean membersOnAxisSorted)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected int
computeColumnCount(int[] axesMembers, int[] axesSize)
protected List<String>
computeColumnNames(List<org.olap4j.CellSetAxis> axes, List<org.olap4j.metadata.Member> columnToMemberMapper)
protected int
computeRowCount(int[] axesSize)
org.pentaho.reporting.engine.classic.core.wizard.DataAttributes
getCellDataAttributes(int rowIndex, int columnIndex)
Returns the meta-attribute as Java-Object.org.pentaho.reporting.engine.classic.core.wizard.DataAttributes
getColumnAttributes(int column)
Class<?>
getColumnClass(int columnIndex)
int
getColumnCount()
String
getColumnName(int column)
Returns a default name for the column using spreadsheet conventions: A, B, C, ...int
getRowCount()
org.pentaho.reporting.engine.classic.core.wizard.DataAttributes
getTableAttributes()
Returns table-wide attributes.Object
getValueAt(int rowIndex, int columnIndex)
boolean
isCellDataAttributesSupported()
-
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
-
BandedMDXTableModel
@Deprecated public BandedMDXTableModel(QueryResultWrapper resultSet, int rowLimit)
Deprecated.
-
BandedMDXTableModel
public BandedMDXTableModel(QueryResultWrapper resultWrapper, int rowLimit, boolean membersOnAxisSorted)
-
-
Method Detail
-
computeColumnCount
protected int computeColumnCount(int[] axesMembers, int[] axesSize)
-
computeRowCount
protected int computeRowCount(int[] axesSize)
-
computeColumnNames
protected List<String> computeColumnNames(List<org.olap4j.CellSetAxis> axes, List<org.olap4j.metadata.Member> columnToMemberMapper)
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfaceTableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfaceTableModel
-
getColumnName
public String getColumnName(int column)
Returns a default name for the column using spreadsheet conventions: A, B, C, ... Z, AA, AB, etc. Ifcolumn
cannot be found, returns an empty string.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
column
- the column being queried- Returns:
- a string containing the default name of
column
-
getValueAt
public Object getValueAt(int rowIndex, int columnIndex)
- Specified by:
getValueAt
in interfaceTableModel
-
getColumnClass
public Class<?> getColumnClass(int columnIndex)
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
close
public void close()
- Specified by:
close
in interfaceorg.pentaho.reporting.engine.classic.core.util.CloseableTableModel
-
getCellDataAttributes
public org.pentaho.reporting.engine.classic.core.wizard.DataAttributes getCellDataAttributes(int rowIndex, int columnIndex)
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 interfaceorg.pentaho.reporting.engine.classic.core.MetaTableModel
- Parameters:
rowIndex
- the row of the cell for which the meta-data is queried.columnIndex
- the index of the column for which the meta-data is queried.- Returns:
- the meta-data object.
-
isCellDataAttributesSupported
public boolean isCellDataAttributesSupported()
- Specified by:
isCellDataAttributesSupported
in interfaceorg.pentaho.reporting.engine.classic.core.MetaTableModel
-
getColumnAttributes
public org.pentaho.reporting.engine.classic.core.wizard.DataAttributes getColumnAttributes(int column)
- Specified by:
getColumnAttributes
in interfaceorg.pentaho.reporting.engine.classic.core.MetaTableModel
-
getTableAttributes
public org.pentaho.reporting.engine.classic.core.wizard.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 interfaceorg.pentaho.reporting.engine.classic.core.MetaTableModel
- Returns:
- the table attributes.
-
-