Interface DAtomicLong

All Superinterfaces:
DType

public interface DAtomicLong extends DType
A distributed and highly-available implementation of AtomicLongs.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    addAndGet(long delta)
    Atomically adds the given value to the current value.
    boolean
    compareAndSet(long expect, long update)
    Atomically sets the value to the given updated value if the current value == the expected value.
    long
    get()
    Gets the current value.
    long
    getAndAdd(long delta)
    Atomically adds the given value to the current value.
    long
    getAndSet(long newValue)
    Atomically sets to the given value and returns the old value.
    void
    set(long value)
    Set the given value atomically.

    Methods inherited from interface com.vmware.gemfire.distributedtypes.DType

    destroy, getName
  • Method Details

    • get

      long get()
      Gets the current value.
      Returns:
      the current value
    • set

      void set(long value)
      Set the given value atomically.
      Parameters:
      value - the value to set
    • getAndAdd

      long getAndAdd(long delta)
      Atomically adds the given value to the current value.
      Parameters:
      delta - the value to add
      Returns:
      the previous value
    • getAndSet

      long getAndSet(long newValue)
      Atomically sets to the given value and returns the old value.
      Parameters:
      newValue - the new value
      Returns:
      the previous value
    • addAndGet

      long addAndGet(long delta)
      Atomically adds the given value to the current value.
      Parameters:
      delta - the value to add
      Returns:
      the updated value
    • compareAndSet

      boolean compareAndSet(long expect, long update)
      Atomically sets the value to the given updated value if the current value == the expected value.
      Parameters:
      expect - the expected value
      update - the new value
      Returns:
      true if successful. False return indicates that the actual value was not equal to the expected value.