Package com.oracle.coherence.common.base
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected long
m_lValue
The value.
-
Constructor Summary
Constructors Constructor Description MutableLong()
Construct a MutableLong with a zero initial value.MutableLong(long lValue)
Construct a MutableLong with the specified value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(MutableLong that)
static ThreadLocal<MutableLong>
createThreadLocal()
Return a ThreadLocal of MutableLong.long
decrementAndGet()
Decrement the long and return the new value.double
doubleValue()
boolean
equals(Object that)
float
floatValue()
long
get()
Return the current value.int
hashCode()
long
incrementAndGet()
Increment the long and return the new value.int
intValue()
long
longValue()
MutableLong
set(long lValue)
Update the valueString
toString()
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Method Detail
-
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
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classNumber
-
compareTo
public int compareTo(MutableLong that)
- Specified by:
compareTo
in interfaceComparable<MutableLong>
-
-