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

Package class diagram package MeanCalculator
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.MeanCalculator<T>
Type Parameters:
T - the enumeration type for the dimensions
All Implemented Interfaces:
Calculator<Double>, CompositeCalculator<Double>

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

Implementation of a calculator for the mean crossing rate of a sensor signal.


Field Summary
private  SensorObservationCounter<T> counter
          The calculator providing the sample count for the mean calculation.
private  SumCalculator<T> sumCalculator
          The calculator providing the sum for the mean calculation.
 
Fields inherited from class org.android.activityminer.logic.features.calculators.AbstractCalculator
dimension, value
 
Constructor Summary
MeanCalculator(SumCalculator<T> sumCalculator, SensorObservationCounter<T> counter)
          Constructor
 
Method Summary
 Double getCompositeValue()
          Does calculate the composite value.
 SensorObservationCounter<T> getCounter()
          Getter for the counter
 Double getInitialValue()
          Method for value initialization.
 SumCalculator<T> getSumCalcualtor()
          Getter for the sum 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

sumCalculator

private final SumCalculator<T extends Enum<T> & Dimensions> sumCalculator
The calculator providing the sum for the mean calculation.


counter

private final SensorObservationCounter<T extends Enum<T> & Dimensions> counter
The calculator providing the sample count for the mean calculation.

Constructor Detail

MeanCalculator

public MeanCalculator(SumCalculator<T> sumCalculator,
                      SensorObservationCounter<T> counter)
Constructor

Parameters:
sumCalculator - the calculator providing the sum for the mean calculation
counter - the calculator providing the sample count for the mean calculation
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

getSumCalcualtor

public SumCalculator<T> getSumCalcualtor()
Getter for the sum calculator.

Returns:
the sum calculator

getCounter

public SensorObservationCounter<T> getCounter()
Getter for the counter

Returns:
the sum calculator