Class MutableLong

java.lang.Object
java.lang.Number
com.oracle.coherence.common.base.MutableLong
All Implemented Interfaces:
Serializable, Comparable<MutableLong>

public class MutableLong extends Number implements Comparable<MutableLong>
A Long like class which supports mutation.
Author:
mf 2014.03.20
See Also:
  • Field Details

    • m_lValue

      protected long m_lValue
      The value.
  • Constructor Details

    • MutableLong

      public MutableLong()
      Construct a MutableLong with a zero initial value.
    • MutableLong

      public MutableLong(long lValue)
      Construct a MutableLong with the specified value.
      Parameters:
      lValue - the initial value
  • Method Details

    • set

      public MutableLong set(long lValue)
      Update the value
      Parameters:
      lValue - the new value
      Returns:
      this object
    • get

      public long get()
      Return the current value.
      Returns:
      the value
    • incrementAndGet

      public long incrementAndGet()
      Increment the long and return the new value.
      Returns:
      the new value
    • decrementAndGet

      public long decrementAndGet()
      Decrement the long and return the new value.
      Returns:
      the new value
    • createThreadLocal

      public static ThreadLocal<MutableLong> createThreadLocal()
      Return a ThreadLocal of MutableLong.
      Returns:
      a ThreadLocal of MutableLong
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
    • longValue

      public long longValue()
      Specified by:
      longValue in class Number
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number
    • doubleValue

      public double doubleValue()
      Specified by:
      doubleValue in class Number
    • compareTo

      public int compareTo(MutableLong that)
      Specified by:
      compareTo in interface Comparable<MutableLong>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object that)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object