public class LongAccumulator extends Object
long
value.Constructor and Description |
---|
LongAccumulator()
Creates a new instance with
value == 0 . |
LongAccumulator(long value)
Creates a new instance with the specified value.
|
Modifier and Type | Method and Description |
---|---|
LongAccumulator |
add(long value)
Adds the supplied value to this accumulator.
|
LongAccumulator |
add(LongAccumulator that)
Adds the value of the supplied accumulator to this accumulator.
|
LongAccumulator |
addExact(long value)
Uses
Math.addExact() to add the
supplied value to this accumulator. |
LongAccumulator |
addExact(LongAccumulator that)
Uses
Math.addExact() to add the value
of the supplied accumulator into this one. |
boolean |
equals(Object o) |
long |
get()
Returns the current value.
|
int |
hashCode() |
LongAccumulator |
set(long value)
Sets the value as given.
|
LongAccumulator |
subtract(LongAccumulator that)
Subtracts the value of the supplied accumulator from this one.
|
LongAccumulator |
subtractExact(LongAccumulator that)
Uses
Math.subtractExact()
to subtract the value of the supplied accumulator from this one. |
String |
toString() |
public LongAccumulator()
value == 0
.public LongAccumulator(long value)
public long get()
public LongAccumulator set(long value)
public LongAccumulator add(long value)
public LongAccumulator add(LongAccumulator that)
public LongAccumulator addExact(long value)
Math.addExact()
to add the
supplied value to this accumulator.public LongAccumulator addExact(LongAccumulator that)
Math.addExact()
to add the value
of the supplied accumulator into this one.public LongAccumulator subtract(LongAccumulator that)
public LongAccumulator subtractExact(LongAccumulator that)
Math.subtractExact()
to subtract the value of the supplied accumulator from this one.Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.