## org.ascape.util.data
Class StatCollectorCSA

    java.lang.Object
      org.ascape.util.data.StatCollector
          org.ascape.util.data.StatCollectorCSA

All Implemented Interfaces:
  java.io.Serializable, java.lang.Comparable, DataPoint, HasName

Direct Known Subclasses:
  StatCollectorCalculated, StatCollectorCondCSA, StatCollectorCSAMM

    public class StatCollectorCSA

extends StatCollector

Stores aggregate data for values obtained for a statistic, including running sum and average.

Since:
  1.0
Version:
  1.2
Author:
  Miles Parker
See Also:
  `StatCollector`, `StatCollectorCond`, Serialized Form

Field Summary
`protected double` `sum`

Fields inherited from class org.ascape.util.data.StatCollector
`allMeasureNames, allMeasureNamesShort, autoCollect, COLLECTING, count, name, NOT_COLLECTING, SET_BY_DATAGROUP`

Constructor Summary
`StatCollectorCSA()` Constructs a new StatCollectorCSA.
`StatCollectorCSA(java.lang.String name)` Constructs a new StatCollectorCSA.
`StatCollectorCSA(java.lang.String name, boolean autoCollect)` Constructs a new StatCollectorCSA.

Method Summary
`void` `addValue(double value)` Add the value, incrementing count and adding sum.
`void` `clear()` Sets all values statistics to base values (0 or max.)
`double` `getAvg()` Returns the current average of all values added.
`double` `getSum()` Returns the current sum of all values added.
`double` `getTotal()` Returns the current sum of all values added.

Methods inherited from class org.ascape.util.data.StatCollector

`addValueFor, calculateCollection, calculateIterator, calculateValue, compareTo, createDataSeries, getAllDataSeries, getAllMeasureNames, getAllMeasureNamesShort, getCollectingLongitudinalDataMode, getCount, getDataGroup, getDataSeries, getName, getValue, isAutoCollect, isCalculated, isCollectingLongitudinalData, isPhase2, setAutoCollect, setCollectingLongitudinalDataMode, setDataGroup, setName, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### sum

    protected double sum

Constructor Detail

### StatCollectorCSA

    public StatCollectorCSA()

  Constructs a new StatCollectorCSA.

### StatCollectorCSA

    public StatCollectorCSA(java.lang.String name,
                            boolean autoCollect)

  Constructs a new StatCollectorCSA.

  Parameters:
    `name` - the name of the stat collector.
    `autoCollect` - should the stat be collected automatically?

### StatCollectorCSA

    public StatCollectorCSA(java.lang.String name)

  Constructs a new StatCollectorCSA. (Automatic by default.)

  Parameters:
    `name` - the name of the stat collector.

Method Detail

### clear

    public void clear()

  Sets all values statistics to base values (0 or max.)

  Overrides:
    `clear` in class `StatCollector`

### addValue

    public void addValue(double value)

  Add the value, incrementing count and adding sum.

  Overrides:
    `addValue` in class `StatCollector`

### getTotal

    public double getTotal()

  Returns the current sum of all values added.

### getSum

    public double getSum()

  Returns the current sum of all values added.

### getAvg

    public double getAvg()

  Returns the current average of all values added.