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>
A Long like class which supports mutation.
- Author:
- mf 2014.03.20
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a MutableLong with a zero initial value.MutableLong(long lValue) Construct a MutableLong with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(MutableLong that) static ThreadLocal<MutableLong>Return a ThreadLocal of MutableLong.longDecrement the long and return the new value.doublebooleanfloatlongget()Return the current value.inthashCode()longIncrement the long and return the new value.intintValue()longset(long lValue) Update the valuetoString()Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
m_lValue
protected long m_lValueThe 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
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
Return a ThreadLocal of MutableLong.- Returns:
- a ThreadLocal of MutableLong
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
compareTo
- Specified by:
compareToin interfaceComparable<MutableLong>
-
hashCode
public int hashCode() -
equals
-
toString
-