Package org.zkoss.pivot.impl.calc
Class VarianceContext
java.lang.Object
org.zkoss.pivot.impl.calc.VarianceContext
- All Implemented Interfaces:
Context<VarianceContext>
The context for calculating variance and standard deviation.
- Author:
- simonpai
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected doubleprotected doublestatic final ContextFactory<VarianceContext> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an item into the aggregation.intRetrieve number count.doublegetSum()Retrieve sum of the numbers.doubleRetrieve sum of the square of the numbers.getVar()getVarP()voidmerge(VarianceContext ctx) Merge from another context of the same type.
-
Field Details
-
_sqsum
protected double _sqsum -
_sum
protected double _sum -
_ncount
protected int _ncount -
FACTORY
-
-
Constructor Details
-
VarianceContext
public VarianceContext()
-
-
Method Details
-
add
Description copied from interface:ContextAdd an item into the aggregation.- Specified by:
addin interfaceContext<VarianceContext>
-
merge
Description copied from interface:ContextMerge from another context of the same type.- Specified by:
mergein interfaceContext<VarianceContext>
-
getSumOfSquare
public double getSumOfSquare()Retrieve sum of the square of the numbers. -
getSum
public double getSum()Retrieve sum of the numbers. -
getNumberCount
public int getNumberCount()Retrieve number count. Non-number objects are ignored. -
getVar
-
getVarP
-