org.pentaho.reporting.engine.classic.core.states.crosstab
Class SortedMergeCrosstabSpecification

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.states.crosstab.SortedMergeCrosstabSpecification
All Implemented Interfaces:
Serializable, CrosstabSpecification

public class SortedMergeCrosstabSpecification
extends Object
implements CrosstabSpecification

Computed structural data of a crosstab. It basically contains the full dataset of the column axis, which then allows us to inject artificial rows into the dataset.

We have the assumption, that the data is already pre-sorted in some way and that all rows are given in that order. We assume that all items are comparable and that the items are sorted according to the natural order of the key. This mode is intended to be used for raw-data crosstabs only. It consumes less memory than the ordered merge.

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
SortedMergeCrosstabSpecification(ReportStateKey key, String[] columnSet)
           
 
Method Summary
 void add(DataRow dataRow)
           
 void endRow()
           
 String[] getColumnNames()
           
 ReportStateKey getKey()
           
 Object[] getKeyAt(int column)
           
 int indexOf(int start, Object[] key)
           
 int size()
          The number of columns encountered.
 void startRow()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedMergeCrosstabSpecification

public SortedMergeCrosstabSpecification(ReportStateKey key,
                                        String[] columnSet)
Method Detail

indexOf

public int indexOf(int start,
                   Object[] key)
Specified by:
indexOf in interface CrosstabSpecification

getColumnNames

public String[] getColumnNames()
Specified by:
getColumnNames in interface CrosstabSpecification

getKey

public ReportStateKey getKey()
Specified by:
getKey in interface CrosstabSpecification

startRow

public void startRow()
Specified by:
startRow in interface CrosstabSpecification

endRow

public void endRow()
Specified by:
endRow in interface CrosstabSpecification

add

public void add(DataRow dataRow)
Specified by:
add in interface CrosstabSpecification

size

public int size()
Description copied from interface: CrosstabSpecification
The number of columns encountered.

Specified by:
size in interface CrosstabSpecification
Returns:

getKeyAt

public Object[] getKeyAt(int column)
Specified by:
getKeyAt in interface CrosstabSpecification