Package com.gengoai.stream.local
Class LocalMLongAccumulator
- java.lang.Object
-
- com.gengoai.stream.local.LocalMAccumulator<Long,Long>
-
- com.gengoai.stream.local.LocalMLongAccumulator
-
- All Implemented Interfaces:
Copyable<LocalMAccumulator<Long,Long>>
,MAccumulator<Long,Long>
,MLongAccumulator
,Serializable
public class LocalMLongAccumulator extends LocalMAccumulator<Long,Long> implements MLongAccumulator
An implementation of a
MLongAccumulator
for local streams- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocalMLongAccumulator(long longValue, String name)
Instantiates a new Local m long accumulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(long value)
Adds the primitive long value.LocalMAccumulator<Long,Long>
copy()
Makes a copy of this object.boolean
isZero()
Determines if the accumulator is a zero valuevoid
merge(MAccumulator<Long,Long> other)
Merges another accumulator with this onevoid
reset()
Resets the accumulator to its zero-value.Long
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
-
Methods inherited from interface com.gengoai.stream.MLongAccumulator
add
-
-
-
-
Constructor Detail
-
LocalMLongAccumulator
public LocalMLongAccumulator(long longValue, String name)
Instantiates a new Local m long accumulator.- Parameters:
longValue
- the initial long valuename
- the name of the accumulator
-
-
Method Detail
-
copy
public LocalMAccumulator<Long,Long> copy()
Description copied from interface:Copyable
Makes a copy of this object.
- Specified by:
copy
in interfaceCopyable<LocalMAccumulator<Long,Long>>
- Returns:
- A copy of this object.
-
add
public void add(long value)
Description copied from interface:MLongAccumulator
Adds the primitive long value.- Specified by:
add
in interfaceMLongAccumulator
- Parameters:
value
- the value to add
-
value
public Long value()
Description copied from interface:MAccumulator
The value of the accumulator.- Specified by:
value
in interfaceMAccumulator<Long,Long>
- 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<Long,Long>
- Returns:
- True if the accumulator is in a zero state
-
merge
public void merge(MAccumulator<Long,Long> other)
Description copied from interface:MAccumulator
Merges another accumulator with this one- Specified by:
merge
in interfaceMAccumulator<Long,Long>
- 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<Long,Long>
-
-