Class MeanAggregator

  • All Implemented Interfaces:
    Aggregator<Double>

    public class MeanAggregator
    extends Object
    implements Aggregator<Double>
    Tracks the mean of all added values. If no values are added, the mean is 0.
    • Field Detail

      • mean

        protected double mean
      • count

        protected long count
    • Constructor Detail

      • MeanAggregator

        public MeanAggregator()
    • Method Detail

      • addValue

        public void addValue​(Double value)
        Description copied from interface: Aggregator
        Adds value to the group of values being aggregated.
        Specified by:
        addValue in interface Aggregator<Double>
      • getCount

        public long getCount()
        Description copied from interface: Aggregator
        Returns the number of values that are aggregated.
        Specified by:
        getCount in interface Aggregator<Double>
      • reset

        public void reset()
        Description copied from interface: Aggregator
        Remove all added values from the group of values being aggregated.
        Specified by:
        reset in interface Aggregator<Double>