public class MutableLong extends Number implements Comparable<MutableLong>, Serializable
Map
or for passing by
reference.Modifier and Type | Field and Description |
---|---|
long |
value
The value.
|
Constructor and Description |
---|
MutableLong()
Default constructor.
|
MutableLong(long value)
Creates an instance with a value.
|
Modifier and Type | Method and Description |
---|---|
long |
addAndGet(long delta)
Add the
delta and get the value. |
byte |
byteValue()
Return value as
byte . |
static int |
compare(long lhs,
long rhs)
Compare two long values.
|
int |
compareTo(MutableLong that) |
void |
decrement()
Decrement the value.
|
long |
decrementAndGet()
Decrement and get the value.
|
double |
doubleValue()
Return value as
double . |
boolean |
equals(Object o) |
float |
floatValue()
Return value as
float . |
long |
get()
Get the value.
|
long |
getAndAdd(long delta)
Get the value and add
delta to it. |
long |
getAndDecrement()
Get the value and decrement it.
|
long |
getAndIncrement()
Get and increment the value.
|
int |
hashCode() |
void |
increment()
Increment the value.
|
long |
incrementAndGet()
Increment and return the value.
|
int |
intValue()
Return value as
int . |
long |
longValue()
Return value as
long . |
void |
set(long value)
Set the value.
|
short |
shortValue()
Return value as
short . |
String |
toString() |
public MutableLong()
public MutableLong(long value)
value
- to assign.public long get()
public void set(long value)
value
- to be assigned.public byte byteValue()
byte
.public short shortValue()
short
.shortValue
in class Number
short
.public int intValue()
int
.public long longValue()
long
.public float floatValue()
float
.floatValue
in class Number
float
.public double doubleValue()
double
.doubleValue
in class Number
double
.public void increment()
public long incrementAndGet()
public long getAndIncrement()
public void decrement()
public long decrementAndGet()
public long getAndDecrement()
public long getAndAdd(long delta)
delta
to it.delta
- to add.public long addAndGet(long delta)
delta
and get the value.delta
- to add.public int compareTo(MutableLong that)
compareTo
in interface Comparable<MutableLong>
public static int compare(long lhs, long rhs)
Long.compare(lhs, rhs);
lhs
- first value.rhs
- second value.0
if lhs == rhs
;
a value less than 0
if lhs < rhs
; and
a value greater than 0
if lhs > rhs
Copyright © 2014-2021 Real Logic Limited. All Rights Reserved.