Class WeightedStatistic

java.lang.Object
  extended by Statistic
      extended by WeightedStatistic

public class WeightedStatistic
extends Statistic

Abstract data type to collect values and provide certain statistical properties of the collection.


Field Summary
 
Fields inherited from class Statistic
currentValue, highestValue, lowestValue, numSamples, statisticName, sumOfValues, sumsqOfValues
 
Constructor Summary
WeightedStatistic(java.lang.String name)
          Constructor.
 
Method Summary
 void collect(double value, int weight)
          Adds a value to the statistic collection
 
Methods inherited from class Statistic
collect, count, current, highest, lowest, mean, name, standardDeviation, sum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeightedStatistic

public WeightedStatistic(java.lang.String name)
Constructor.

Parameters:
name - String with descriptive name for this object
Method Detail

collect

public void collect(double value,
                    int weight)
Adds a value to the statistic collection

Parameters:
value - the value to be sampled
weight - the weight this value caries
Postcondition:
statistic object is updated to reflect addition of new weighted value