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 longm_lValueThe 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 intcompareTo(MutableLong that)static ThreadLocal<MutableLong>createThreadLocal()Return a ThreadLocal of MutableLong.longdecrementAndGet()Decrement the long and return the new value.doubledoubleValue()booleanequals(Object that)floatfloatValue()longget()Return the current value.inthashCode()longincrementAndGet()Increment the long and return the new value.intintValue()longlongValue()MutableLongset(long lValue)Update the valueStringtoString()-
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:
floatValuein classNumber
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein classNumber
-
compareTo
public int compareTo(MutableLong that)
- Specified by:
compareToin interfaceComparable<MutableLong>
-
-