Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot.table.aggregator
Class RankAggregator

java.lang.Object
  extended by com.citra.pivot.table.aggregator.NumericalAggregator
      extended by com.citra.pivot.table.aggregator.RankAggregator
All Implemented Interfaces:
DerivedMeasureAggregator, TableAggregator

public class RankAggregator
extends NumericalAggregator
implements DerivedMeasureAggregator

RankAggregator is used to create ranking for a given measure in the context of a dimension.


Field Summary
protected  boolean ascending
          whether to rank in ascending or descending order
protected  TableDimension dimension
          the dimension context
static int RANK_LEVEL
          constant defining that the ranking should involve all level members of the dimension
static int RANK_PARENT
          constant defining that the ranking should involve all sibling members of the dimension
static int RANK_TOTAL
          constant defining that the ranking should involve all members of the dimension
protected  int rankMode
          the ranking mode
 
Fields inherited from class com.citra.pivot.table.aggregator.NumericalAggregator
aggregationType
 
Constructor Summary
RankAggregator(TableDimension dimension)
          Constructs a RankAggregator.
RankAggregator(TableDimension dimension, boolean ascending)
          Constructs a RankAggregator.
RankAggregator(TableDimension dimension, boolean ascending, int rankMode)
          Constructs a RankAggregator.
RankAggregator(TableDimension dimension, boolean ascending, int rankMode, OlapType type)
          Constructs a RankAggregator.
 
Method Summary
 Object aggregate(TableQuery query, TableConnection connection, TableMeasure measure, TableMeasure inputMeasure)
          Aggregates the derived measure of a table datasource and returns the result.
 String getName()
          Retrieves the name of the aggregator.
 
Methods inherited from class com.citra.pivot.table.aggregator.NumericalAggregator
getType, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dimension

protected TableDimension dimension
the dimension context


ascending

protected boolean ascending
whether to rank in ascending or descending order


rankMode

protected int rankMode
the ranking mode


RANK_TOTAL

public static final int RANK_TOTAL
constant defining that the ranking should involve all members of the dimension

See Also:
Constant Field Values

RANK_PARENT

public static final int RANK_PARENT
constant defining that the ranking should involve all sibling members of the dimension

See Also:
Constant Field Values

RANK_LEVEL

public static final int RANK_LEVEL
constant defining that the ranking should involve all level members of the dimension

See Also:
Constant Field Values
Constructor Detail

RankAggregator

public RankAggregator(TableDimension dimension)
Constructs a RankAggregator.


RankAggregator

public RankAggregator(TableDimension dimension,
                      boolean ascending)
Constructs a RankAggregator.


RankAggregator

public RankAggregator(TableDimension dimension,
                      boolean ascending,
                      int rankMode)
Constructs a RankAggregator.


RankAggregator

public RankAggregator(TableDimension dimension,
                      boolean ascending,
                      int rankMode,
                      OlapType type)
Constructs a RankAggregator.

Method Detail

aggregate

public Object aggregate(TableQuery query,
                        TableConnection connection,
                        TableMeasure measure,
                        TableMeasure inputMeasure)
                 throws DataSourceException
Aggregates the derived measure of a table datasource and returns the result.

Specified by:
aggregate in interface DerivedMeasureAggregator
Parameters:
query - contains the parameters to table members that are being aggregated
connection - the connection to the table datasource
measure - the measure being aggregated
Returns:
the aggregated value
Throws:
DataSourceException

getName

public String getName()
Retrieves the name of the aggregator.

Specified by:
getName in interface TableAggregator
Returns:
the aggregator's name

Copyright © 2011 Citra Technologies. All Rights Reserved.