Package com.hazelcast.jet.accumulator
Class LongAccumulator
java.lang.Object
com.hazelcast.jet.accumulator.LongAccumulator
Mutable container of a
long
value.- Since:
- Jet 3.0
-
Constructor Summary
ConstructorDescriptionCreates a new instance withvalue == 0
.LongAccumulator
(long value) Creates a new instance with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionadd
(long value) Adds the supplied value to this accumulator, throwing an exception in the case of integer overflow.add
(LongAccumulator that) Adds the value of the supplied accumulator to this accumulator, throwing an exception in the case of integer overflow.addAllowingOverflow
(long value) Adds the supplied value to this accumulator, allowing integer overflow.Adds the value of the supplied accumulator to this accumulator, allowing integer overflow.boolean
long
get()
Returns the current value.int
hashCode()
set
(long value) Sets the value as given.subtract
(long value) Subtracts the supplied value from this accumulator, throwing an exception in the case of integer overflow.subtract
(LongAccumulator that) Subtracts the value of the supplied accumulator from this one, throwing an exception in the case of integer overflow.subtractAllowingOverflow
(long value) Subtracts the supplied value from this accumulator, allowing integer overflow.Subtracts the value of the supplied accumulator from this one, allowing integer overflow.toString()
-
Constructor Details
-
LongAccumulator
public LongAccumulator()Creates a new instance withvalue == 0
. -
LongAccumulator
public LongAccumulator(long value) Creates a new instance with the specified value.
-
-
Method Details
-
get
public long get()Returns the current value. -
set
Sets the value as given. -
add
Adds the supplied value to this accumulator, throwing an exception in the case of integer overflow. -
add
Adds the value of the supplied accumulator to this accumulator, throwing an exception in the case of integer overflow. -
subtract
Subtracts the supplied value from this accumulator, throwing an exception in the case of integer overflow. -
subtract
Subtracts the value of the supplied accumulator from this one, throwing an exception in the case of integer overflow. -
addAllowingOverflow
Adds the supplied value to this accumulator, allowing integer overflow. This removes the (tiny) overhead of overflow checking. -
addAllowingOverflow
Adds the value of the supplied accumulator to this accumulator, allowing integer overflow. This removes the (tiny) overhead of overflow checking. -
subtractAllowingOverflow
Subtracts the supplied value from this accumulator, allowing integer overflow. This removes the (tiny) overhead of overflow checking. -
subtractAllowingOverflow
Subtracts the value of the supplied accumulator from this one, allowing integer overflow. This removes the (tiny) overhead of overflow checking. -
equals
-
hashCode
public int hashCode() -
toString
-