Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot.table.aggregator
Class MovingTotalAggregator

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

public class MovingTotalAggregator
extends NumericalAggregator
implements DerivedMeasureAggregator

MovingTotalAggregator produces a moving total aggregation of a given measure in the context of a dimension.


Field Summary
static int BEGINNING
          constant designating the first child in the level
protected  TableDimension dimension
          the dimension context
static int END
          constant designating the last child in the level
protected  int nextOffset
          the offset to lead the current member
protected  int previousOffset
          the offset to lag the current member
 
Fields inherited from class com.citra.pivot.table.aggregator.NumericalAggregator
aggregationType
 
Constructor Summary
MovingTotalAggregator(TableDimension dimension)
          Constructs a MovingTotalAggregator.
MovingTotalAggregator(TableDimension dimension, int previousOffset, int nextOffset)
          Constructs a MovingTotalAggregator.
MovingTotalAggregator(TableDimension dimension, int previousOffset, int nextOffset, OlapType type)
          Constructs a MovingTotalAggregator.
MovingTotalAggregator(TableDimension dimension, OlapType type)
          Constructs a MovingTotalAggregator.
 
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.
 void setNextOffset(int nextOffset)
          Assigns the offset to lead the current member.
 void setPreviousOffset(int previousOffset)
          Assigns the offset to lag the current member.
 
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


previousOffset

protected int previousOffset
the offset to lag the current member


nextOffset

protected int nextOffset
the offset to lead the current member


BEGINNING

public static final int BEGINNING
constant designating the first child in the level

See Also:
Constant Field Values

END

public static final int END
constant designating the last child in the level

See Also:
Constant Field Values
Constructor Detail

MovingTotalAggregator

public MovingTotalAggregator(TableDimension dimension)
Constructs a MovingTotalAggregator.


MovingTotalAggregator

public MovingTotalAggregator(TableDimension dimension,
                             int previousOffset,
                             int nextOffset)
Constructs a MovingTotalAggregator.


MovingTotalAggregator

public MovingTotalAggregator(TableDimension dimension,
                             int previousOffset,
                             int nextOffset,
                             OlapType type)
Constructs a MovingTotalAggregator.


MovingTotalAggregator

public MovingTotalAggregator(TableDimension dimension,
                             OlapType type)
Constructs a MovingTotalAggregator.

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

setNextOffset

public void setNextOffset(int nextOffset)
Assigns the offset to lead the current member.

Parameters:
nextOffset - the offset to lead the current member

setPreviousOffset

public void setPreviousOffset(int previousOffset)
Assigns the offset to lag the current member.

Parameters:
previousOffset - the offset to lag the current member

Copyright © 2011 Citra Technologies. All Rights Reserved.