Class JreDoubleAdder
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.concurrent.JreDoubleAdder
-
- All Implemented Interfaces:
DoubleAdder
final class JreDoubleAdder extends java.lang.Object implements DoubleAdder
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.DoubleAdderdelegate
-
Constructor Summary
Constructors Constructor Description JreDoubleAdder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double x)Add the given value.voidreset()Resets the variables maintaining the sum to zero.doublesum()Returns the current sum.doublesumThenReset()Equivalent in effect toDoubleAdder.sum()followed byDoubleAdder.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.DoubleAdder
doubleValue, floatValue, intValue, longValue
-
-
-
-
Method Detail
-
add
public void add(double x)
Description copied from interface:DoubleAdderAdd the given value.- Specified by:
addin interfaceDoubleAdder- Parameters:
x- the value to add- See Also:
DoubleAdder.add(double)
-
sum
public double sum()
Description copied from interface:DoubleAdderReturns the current sum.- Specified by:
sumin interfaceDoubleAdder- See Also:
DoubleAdder.sum()
-
reset
public void reset()
Description copied from interface:DoubleAdderResets the variables maintaining the sum to zero.- Specified by:
resetin interfaceDoubleAdder- See Also:
DoubleAdder.reset()
-
sumThenReset
public double sumThenReset()
Description copied from interface:DoubleAdderEquivalent in effect toDoubleAdder.sum()followed byDoubleAdder.reset().- Specified by:
sumThenResetin interfaceDoubleAdder- Returns:
- the sum
- See Also:
DoubleAdder.sumThenReset()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-