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