Class/Object

monifu.concurrent.atomic

AtomicDouble

Related Docs: object AtomicDouble | package atomic

Permalink

final class AtomicDouble extends AtomicNumber[Double] with BlockableAtomic[Double]

Source
AtomicDouble.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AtomicDouble
  2. BlockableAtomic
  3. AtomicNumber
  4. Atomic
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +=(v: Double): Unit

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
  4. def -=(v: Double): Unit

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
  5. def :=(value: Double): Unit

    Permalink

    Alias for set().

    Alias for set(). Updates the current value.

    value

    will be the new value returned by get()

    Definition Classes
    AtomicDoubleAtomic
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. def add(v: Double): Unit

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  8. def addAndGet(v: Double): Double

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  9. def apply(): Double

    Permalink

    returns

    the current value persisted by this Atomic, an alias for get()

    Definition Classes
    Atomic
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def compareAndSet(expect: Double, update: Double): Boolean

    Permalink

    Does a compare-and-set operation on the current value.

    Does a compare-and-set operation on the current value. For more info, checkout the related Compare-and-swap Wikipedia page.

    It's an atomic, worry free operation.

    expect

    is the value you expect to be persisted when the operation happens

    update

    will be the new value, should the check for expect succeeds

    returns

    either true in case the operation succeeded or false otherwise

    Definition Classes
    AtomicDoubleAtomic
  13. def countDownToZero(v: Double = 1.0): Double

    Permalink

    Decrements this number until it reaches zero.

    Decrements this number until it reaches zero.

    returns

    a number representing how much it was able to subtract, which is a value between zero and v

    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  14. def decrement(v: Int = 1): Unit

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
  15. def decrementAndGet(v: Int = 1): Double

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def get: Double

    Permalink

    returns

    the current value persisted by this Atomic

    Definition Classes
    AtomicDoubleAtomic
  20. def getAndAdd(v: Double): Double

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  21. def getAndDecrement(v: Int = 1): Double

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
  22. def getAndIncrement(v: Int = 1): Double

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  23. def getAndSet(update: Double): Double

    Permalink

    Sets the persisted value to update and returns the old value that was in place.

    Sets the persisted value to update and returns the old value that was in place. It's an atomic, worry free operation.

    Definition Classes
    AtomicDoubleAtomic
  24. def getAndSubtract(v: Double): Double

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  25. def getAndTransform(cb: (Double) ⇒ Double): Double

    Permalink

    Abstracts over compareAndSet.

    Abstracts over compareAndSet. You specify a transformation by specifying a callback to be executed, a callback that transforms the current value. This method will loop until it will succeed in replacing the current value with the one produced by the given callback.

    Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.

    cb

    is a callback that receives the current value as input and returns the update which is the new value that should be persisted

    returns

    the old value, just prior to when the successful update happened

    Definition Classes
    AtomicDoubleAtomic
    Annotations
    @tailrec()
  26. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  28. def increment(v: Int = 1): Unit

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  29. def incrementAndGet(v: Int = 1): Double

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. def lazySet(update: Double): Unit

    Permalink

    Eventually sets to the given value.

    Eventually sets to the given value. Has weaker visibility guarantees than the normal set().

    Definition Classes
    AtomicDoubleAtomic
  32. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  33. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  35. def set(update: Double): Unit

    Permalink

    Updates the current value.

    Updates the current value.

    update

    will be the new value returned by get()

    Definition Classes
    AtomicDoubleAtomic
  36. def subtract(v: Double): Unit

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  37. def subtractAndGet(v: Double): Double

    Permalink
    Definition Classes
    AtomicDoubleAtomicNumber
    Annotations
    @tailrec()
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  40. def transform(cb: (Double) ⇒ Double): Unit

    Permalink

    Abstracts over compareAndSet.

    Abstracts over compareAndSet. You specify a transformation by specifying a callback to be executed, a callback that transforms the current value. This method will loop until it will succeed in replacing the current value with the one produced by the given callback.

    Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.

    cb

    is a callback that receives the current value as input and returns the update which is the new value that should be persisted

    Definition Classes
    AtomicDoubleAtomic
    Annotations
    @tailrec()
  41. def transformAndExtract[U](cb: (Double) ⇒ (U, Double)): U

    Permalink

    Abstracts over compareAndSet.

    Abstracts over compareAndSet. You specify a transformation by specifying a callback to be executed, a callback that transforms the current value. This method will loop until it will succeed in replacing the current value with the one produced by your callback.

    Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.

    cb

    is a callback that receives the current value as input and returns a tuple that specifies the update + what should this method return when the operation succeeds.

    returns

    whatever was specified by your callback, once the operation succeeds

    Definition Classes
    AtomicDoubleAtomic
    Annotations
    @tailrec()
  42. def transformAndGet(cb: (Double) ⇒ Double): Double

    Permalink

    Abstracts over compareAndSet.

    Abstracts over compareAndSet. You specify a transformation by specifying a callback to be executed, a callback that transforms the current value. This method will loop until it will succeed in replacing the current value with the one produced by the given callback.

    Note that the callback will be executed on each iteration of the loop, so it can be called multiple times - don't do destructive I/O or operations that mutate global state in it.

    cb

    is a callback that receives the current value as input and returns the update which is the new value that should be persisted

    returns

    whatever the update is, after the operation succeeds

    Definition Classes
    AtomicDoubleAtomic
    Annotations
    @tailrec()
  43. def update(value: Double): Unit

    Permalink

    Alias for set().

    Alias for set(). Updates the current value.

    value

    will be the new value returned by get()

    Definition Classes
    AtomicDoubleAtomic
  44. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. def waitForCompareAndSet(expect: Double, update: Double, waitAtMost: FiniteDuration): Unit

    Permalink

    Waits until the compareAndSet operation succeeds, e.g...

    Waits until the compareAndSet operation succeeds, e.g... 1. until the old value == expected and the operation succeeds, or 2. until the current thread is interrupted, or 3. the specified timeout is due

    So this can throw an exception on timeout, useful for when you want to insure that you don't block the current thread ad infinitum

    waitAtMost

    specifies the timeout, after which this method throws a TimeoutException

    Definition Classes
    AtomicDoubleBlockableAtomic
    Annotations
    @throws( classOf[InterruptedException] ) @throws( classOf[TimeoutException] )
  48. def waitForCompareAndSet(expect: Double, update: Double, maxRetries: Int): Boolean

    Permalink

    Waits until the compareAndSet operation succeeds, e.g...

    Waits until the compareAndSet operation succeeds, e.g...

    1. until the old value == expected and the operation succeeds, or 2. until the current thread is interrupted 3. until the the spin lock retried for a maximum of maxRetries

    expect

    the expected current value

    update

    the value to replace the current value

    maxRetries

    the maximum number of times to retry in case of failure

    returns

    true if the operation succeeded or false in case it failed after it retried for maxRetries times

    Definition Classes
    AtomicDoubleBlockableAtomic
    Annotations
    @tailrec() @throws( classOf[InterruptedException] )
  49. def waitForCompareAndSet(expect: Double, update: Double): Unit

    Permalink

    Waits until the compareAndSet operation succeeds, e.g...

    Waits until the compareAndSet operation succeeds, e.g... 1. until the old value == expected and the operation succeeds, or 2. until the current thread is interrupted

    Definition Classes
    AtomicDoubleBlockableAtomic
    Annotations
    @tailrec() @throws( classOf[InterruptedException] )
  50. def waitForCondition(waitAtMost: FiniteDuration, p: (Double) ⇒ Boolean): Unit

    Permalink

    Waits until the specified callback, that receives the current value, returns true.

    Waits until the specified callback, that receives the current value, returns true. Throws a TimeoutException in case the specified waitAtMost timeout is due.

    Definition Classes
    AtomicDoubleBlockableAtomic
    Annotations
    @throws( classOf[InterruptedException] ) @throws( classOf[TimeoutException] )
  51. def waitForCondition(p: (Double) ⇒ Boolean): Unit

    Permalink

    Waits until the specified callback, that receives the current value, returns true.

    Waits until the specified callback, that receives the current value, returns true.

    Definition Classes
    AtomicDoubleBlockableAtomic
    Annotations
    @tailrec() @throws( classOf[InterruptedException] )
  52. def waitForValue(expect: Double, waitAtMost: FiniteDuration): Unit

    Permalink

    Waits until the specified expect value == the value stored by this Atomic reference or until the current thread gets interrupted.

    Waits until the specified expect value == the value stored by this Atomic reference or until the current thread gets interrupted.

    This can throw an exception on timeout, useful for when you want to insure that you don't block the current thread ad infinitum

    waitAtMost

    specifies the timeout, after which this method throws a TimeoutException

    Definition Classes
    AtomicDoubleBlockableAtomic
    Annotations
    @throws( classOf[InterruptedException] ) @throws( classOf[TimeoutException] )
  53. def waitForValue(expect: Double): Unit

    Permalink

    Waits until the specified expect value == the value stored by this Atomic reference or until the current thread gets interrupted.

    Waits until the specified expect value == the value stored by this Atomic reference or until the current thread gets interrupted.

    Definition Classes
    AtomicDoubleBlockableAtomic
    Annotations
    @tailrec() @throws( classOf[InterruptedException] )

Inherited from BlockableAtomic[Double]

Inherited from AtomicNumber[Double]

Inherited from Atomic[Double]

Inherited from AnyRef

Inherited from Any

Ungrouped