Documentation of 'jsat.utils.concurrent.AtomicDouble' Java class
AtomicDouble
jsat.utils.concurrent

Class AtomicDouble



  • public final class AtomicDouble
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      AtomicDouble(double value) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double accumulateAndGet(double x, java.util.function.DoubleBinaryOperator accumulatorFunction)
      Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value.
      double addAndGet(double delta)
      Atomically adds the given value to the current value.
      boolean compareAndSet(double expect, double update) 
      double get() 
      double getAndAccumulate(double x, java.util.function.DoubleBinaryOperator accumulatorFunction)
      Atomically updates the current value with the results of applying the given function to the current and given values, returning the previous value.
      double getAndAdd(double delta) 
      double getAndUpdate(java.util.function.DoubleUnaryOperator updateFunction)
      Atomically updates the current value with the results of applying the given function, returning the previous value.
      void set(double val) 
      java.lang.String toString() 
      double updateAndGet(java.util.function.DoubleUnaryOperator updateFunction)
      Atomically updates the current value with the results of applying the given function, returning the updated value.
      boolean weakCompareAndSet(double expect, double update) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AtomicDouble

        public AtomicDouble(double value)
    • Method Detail

      • set

        public void set(double val)
      • get

        public double get()
      • getAndAdd

        public double getAndAdd(double delta)
      • addAndGet

        public final double addAndGet(double delta)
        Atomically adds the given value to the current value.
        Parameters:
        delta - the value to add
        Returns:
        the updated value
      • updateAndGet

        public final double updateAndGet(java.util.function.DoubleUnaryOperator updateFunction)
        Atomically updates the current value with the results of applying the given function, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.
        Parameters:
        updateFunction - a side-effect-free function
        Returns:
        the updated value
      • getAndUpdate

        public final double getAndUpdate(java.util.function.DoubleUnaryOperator updateFunction)
        Atomically updates the current value with the results of applying the given function, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads.
        Parameters:
        updateFunction - a side-effect-free function
        Returns:
        the previous value
      • getAndAccumulate

        public final double getAndAccumulate(double x,
                                             java.util.function.DoubleBinaryOperator accumulatorFunction)
        Atomically updates the current value with the results of applying the given function to the current and given values, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument.
        Parameters:
        x - the update value
        accumulatorFunction - a side-effect-free function of two arguments
        Returns:
        the previous value
      • accumulateAndGet

        public final double accumulateAndGet(double x,
                                             java.util.function.DoubleBinaryOperator accumulatorFunction)
        Atomically updates the current value with the results of applying the given function to the current and given values, returning the updated value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads. The function is applied with the current value as its first argument, and the given update as the second argument.
        Parameters:
        x - the update value
        accumulatorFunction - a side-effect-free function of two arguments
        Returns:
        the updated value
      • compareAndSet

        public boolean compareAndSet(double expect,
                                     double update)
      • weakCompareAndSet

        public boolean weakCompareAndSet(double expect,
                                         double update)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.