Package com.gengoai.stream.local
Class LocalMStatisticsAccumulator
- java.lang.Object
-
- com.gengoai.stream.local.LocalMAccumulator<Double,EnhancedDoubleStatistics>
-
- com.gengoai.stream.local.LocalMStatisticsAccumulator
-
- All Implemented Interfaces:
Copyable<LocalMAccumulator<Double,EnhancedDoubleStatistics>>
,MAccumulator<Double,EnhancedDoubleStatistics>
,MStatisticsAccumulator
,Serializable
public class LocalMStatisticsAccumulator extends LocalMAccumulator<Double,EnhancedDoubleStatistics> implements MStatisticsAccumulator
An implementation of a
MStatisticsAccumulator
for local streams- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocalMStatisticsAccumulator(String name)
Instantiates a new LocalMStatisticsAccumulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(double value)
Adds a value to the statistics accumulator.void
add(Double aDouble)
Adds an item to the accumulatorvoid
combine(EnhancedDoubleStatistics statistics)
Combines the given statistics with this one.LocalMAccumulator<Double,EnhancedDoubleStatistics>
copy()
Makes a copy of this object.boolean
isZero()
Determines if the accumulator is a zero valuevoid
merge(MAccumulator<Double,EnhancedDoubleStatistics> other)
Merges another accumulator with this onevoid
reset()
Resets the accumulator to its zero-value.EnhancedDoubleStatistics
value()
The value of the accumulator.-
Methods inherited from class com.gengoai.stream.local.LocalMAccumulator
name, register, report
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gengoai.stream.MAccumulator
name, register, report
-
-
-
-
Constructor Detail
-
LocalMStatisticsAccumulator
public LocalMStatisticsAccumulator(String name)
Instantiates a new LocalMStatisticsAccumulator.- Parameters:
name
- the name of the accumulator
-
-
Method Detail
-
add
public void add(double value)
Description copied from interface:MStatisticsAccumulator
Adds a value to the statistics accumulator.- Specified by:
add
in interfaceMStatisticsAccumulator
- Parameters:
value
- the value to add
-
add
public void add(Double aDouble)
Description copied from interface:MAccumulator
Adds an item to the accumulator- Specified by:
add
in interfaceMAccumulator<Double,EnhancedDoubleStatistics>
- Parameters:
aDouble
- the item to add
-
copy
public LocalMAccumulator<Double,EnhancedDoubleStatistics> copy()
Description copied from interface:Copyable
Makes a copy of this object.
- Specified by:
copy
in interfaceCopyable<LocalMAccumulator<Double,EnhancedDoubleStatistics>>
- Returns:
- A copy of this object.
-
value
public EnhancedDoubleStatistics value()
Description copied from interface:MAccumulator
The value of the accumulator.- Specified by:
value
in interfaceMAccumulator<Double,EnhancedDoubleStatistics>
- Returns:
- the result of the accumulator
-
isZero
public boolean isZero()
Description copied from interface:MAccumulator
Determines if the accumulator is a zero value- Specified by:
isZero
in interfaceMAccumulator<Double,EnhancedDoubleStatistics>
- Returns:
- True if the accumulator is in a zero state
-
merge
public void merge(MAccumulator<Double,EnhancedDoubleStatistics> other)
Description copied from interface:MAccumulator
Merges another accumulator with this one- Specified by:
merge
in interfaceMAccumulator<Double,EnhancedDoubleStatistics>
- Parameters:
other
- the other accumulator to merge
-
reset
public void reset()
Description copied from interface:MAccumulator
Resets the accumulator to its zero-value.- Specified by:
reset
in interfaceMAccumulator<Double,EnhancedDoubleStatistics>
-
combine
public void combine(EnhancedDoubleStatistics statistics)
Description copied from interface:MStatisticsAccumulator
Combines the given statistics with this one.- Specified by:
combine
in interfaceMStatisticsAccumulator
- Parameters:
statistics
- the statistics to combine
-
-