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
-
Constructor Summary
ConstructorDescriptionConstruct a MutableLong with a zero initial value.MutableLong
(long lValue) Construct a MutableLong with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(MutableLong that) static ThreadLocal
<MutableLong> Return a ThreadLocal of MutableLong.long
Decrement the long and return the new value.double
boolean
float
long
get()
Return the current value.int
hashCode()
long
Increment the long and return the new value.int
intValue()
long
set
(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:
floatValue
in classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MutableLong>
-
hashCode
public int hashCode() -
equals
-
toString
-