Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot.table.aggregator
Class Functions.WeightedSumFunction

java.lang.Object
  extended by com.citra.pivot.table.aggregator.Functions.WeightedSumFunction
All Implemented Interfaces:
Functions.Function
Enclosing class:
Functions

public static class Functions.WeightedSumFunction
extends Object
implements Functions.Function

The weighted sum function.


Field Summary
protected  List weights
          the weights
 
Constructor Summary
Functions.WeightedSumFunction()
          Constructs a WeightedSumFunction.
Functions.WeightedSumFunction(List weights)
          Constructs a WeightedSumFunction.
 
Method Summary
 Object evaluate(List values, OlapType type)
          Produces an aggregate from a list of values.
 List getWeights()
          Retrieves the weights.
 void setWeights(List weights)
          Assigns a new set of weights.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

weights

protected List weights
the weights

Constructor Detail

Functions.WeightedSumFunction

public Functions.WeightedSumFunction()
Constructs a WeightedSumFunction.


Functions.WeightedSumFunction

public Functions.WeightedSumFunction(List weights)
Constructs a WeightedSumFunction.

Method Detail

setWeights

public void setWeights(List weights)
Assigns a new set of weights.

Parameters:
weights - the weights to assign

getWeights

public List getWeights()
Retrieves the weights.

Returns:
the weights

evaluate

public Object evaluate(List values,
                       OlapType type)
Produces an aggregate from a list of values.

Specified by:
evaluate in interface Functions.Function
Parameters:
values - the list of values
type - the data type the evaluation will be based on
Returns:
the aggregate value

Copyright © 2011 Citra Technologies. All Rights Reserved.