org.zkoss.pivot.impl.calc
Class VarianceContext

java.lang.Object
  extended by org.zkoss.pivot.impl.calc.VarianceContext
All Implemented Interfaces:
Context<VarianceContext>

public class VarianceContext
extends java.lang.Object
implements Context<VarianceContext>

The context for calculating variance and standard deviation.

Author:
simonpai

Field Summary
protected  int _ncount
           
protected  double _sqsum
           
protected  double _sum
           
static ContextFactory<VarianceContext> FACTORY
           
 
Constructor Summary
VarianceContext()
           
 
Method Summary
 void add(java.lang.Object item)
          Add an item into the aggregation.
 int getNumberCount()
          Retrieve number count.
 double getSum()
          Retrieve sum of the numbers.
 double getSumOfSquare()
          Retrieve sum of the square of the numbers.
 java.lang.Double getVar()
           
 java.lang.Double getVarP()
           
 void merge(VarianceContext ctx)
          Merge from another context of the same type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sqsum

protected double _sqsum

_sum

protected double _sum

_ncount

protected int _ncount

FACTORY

public static final ContextFactory<VarianceContext> FACTORY
Constructor Detail

VarianceContext

public VarianceContext()
Method Detail

add

public void add(java.lang.Object item)
Description copied from interface: Context
Add an item into the aggregation.

Specified by:
add in interface Context<VarianceContext>

merge

public void merge(VarianceContext ctx)
Description copied from interface: Context
Merge from another context of the same type.

Specified by:
merge in interface Context<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

public java.lang.Double getVar()

getVarP

public java.lang.Double getVarP()


Copyright © 2013. All Rights Reserved.