Interface DoubleAdder

All Known Implementing Classes:
AtomicLongDoubleAdder, JreDoubleAdder

public interface DoubleAdder
Interface mirroring the DoubleAdder API, with implementation that varies based on availability of DoubleAdder. This offers compatibility for Android 21 without compromising performance in runtimes where DoubleAdder is available.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(double x)
    Add the given value.
    default double
    Equivalent to sum().
    default float
    Returns the sum() as a float after a narrowing primitive conversion.
    default int
    Returns the sum() as a int after a narrowing primitive conversion.
    default long
    Returns the sum() as a long after a narrowing primitive conversion.
    void
    Resets the variables maintaining the sum to zero.
    double
    sum()
    Returns the current sum.
    double
    Equivalent in effect to sum() followed by reset().