Class JreLongAdder
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.concurrent.JreLongAdder
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.LongAdderdelegate
-
Constructor Summary
Constructors Constructor Description JreLongAdder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(long x)Add the given value.voidreset()Resets the variables maintaining the sum to zero.longsum()Returns the current sum.longsumThenReset()Equivalent in effect toLongAdder.sum()followed byLongAdder.reset().java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.sdk.metrics.internal.concurrent.LongAdder
decrement, doubleValue, floatValue, increment, intValue, longValue
-
-
-
-
Method Detail
-
add
public void add(long x)
Description copied from interface:LongAdderAdd the given value.
-
sum
public long sum()
Description copied from interface:LongAdderReturns the current sum.
-
reset
public void reset()
Description copied from interface:LongAdderResets the variables maintaining the sum to zero.
-
sumThenReset
public long sumThenReset()
Description copied from interface:LongAdderEquivalent in effect toLongAdder.sum()followed byLongAdder.reset().- Specified by:
sumThenResetin interfaceLongAdder- Returns:
- the sum
- See Also:
LongAdder.sumThenReset()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-