org.android.activityminer.logic.features.calculators
Class VarianceCalculator<T extends Enum<T> & Dimensions>

Package class diagram package VarianceCalculator
java.lang.Object
  extended by org.android.activityminer.logic.features.calculators.AbstractCalculator<T,U>
      extended by org.android.activityminer.logic.features.calculators.AbstractCompositeCalculator<T,Double>
          extended by org.android.activityminer.logic.features.calculators.VarianceCalculator<T>
Type Parameters:
T - the enumeration type for the dimensions
All Implemented Interfaces:
Calculator<Double>, CompositeCalculator<Double>

public final class VarianceCalculator<T extends Enum<T> & Dimensions>
extends AbstractCompositeCalculator<T,Double>

Implementation of a calculator for the variance in the values of a dimension.


Field Summary
private  double[] diffs2Mean
          The value cache for the difference of single values from mean.
private  MeanCalculator<T> meanCalculator
          The calculator providing the mean value.
private  DimensionValueCache<T> valueCache
          The value cache.
 
Fields inherited from class org.android.activityminer.logic.features.calculators.AbstractCalculator
dimension, value
 
Constructor Summary
VarianceCalculator(DimensionValueCache<T> valueCache, MeanCalculator<T> meanCalculator)
          Constructor
 
Method Summary
 Double getCompositeValue()
          Does calculate the composite value.
 double[] getDiffs2Mean()
          Getter for the value differences to the mean of all values
 Double getInitialValue()
          Method for value initialization.
 MeanCalculator<T> getMeanCalculator()
          Getter for the mean calculator.
 DimensionValueCache<T> getValueCache()
          Getter for the value cache calculator.
 
Methods inherited from class org.android.activityminer.logic.features.calculators.AbstractCompositeCalculator
getValue, reset
 
Methods inherited from class org.android.activityminer.logic.features.calculators.AbstractCalculator
getDimension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valueCache

private final DimensionValueCache<T extends Enum<T> & Dimensions> valueCache
The value cache.


diffs2Mean

private double[] diffs2Mean
The value cache for the difference of single values from mean.


meanCalculator

private final MeanCalculator<T extends Enum<T> & Dimensions> meanCalculator
The calculator providing the mean value.

Constructor Detail

VarianceCalculator

public VarianceCalculator(DimensionValueCache<T> valueCache,
                          MeanCalculator<T> meanCalculator)
Constructor

Parameters:
valueCache - the value cache
meanCalculator - the mean calculator
Method Detail

getInitialValue

public final Double getInitialValue()
Description copied from interface: Calculator
Method for value initialization.

Returns:
the initialized value

getCompositeValue

public Double getCompositeValue()
Description copied from interface: CompositeCalculator
Does calculate the composite value.

Returns:
the composite value

getDiffs2Mean

public double[] getDiffs2Mean()
Getter for the value differences to the mean of all values

Returns:
the value differences to the mean

getMeanCalculator

public MeanCalculator<T> getMeanCalculator()
Getter for the mean calculator.

Returns:
the mean calculator

getValueCache

public DimensionValueCache<T> getValueCache()
Getter for the value cache calculator.

Returns:
the value cache