public final class MutableInteger extends Number implements Comparable<MutableInteger>
Constructor and Description |
---|
MutableInteger() |
MutableInteger(int i) |
Modifier and Type | Method and Description |
---|---|
byte |
byteValue() |
int |
compareTo(MutableInteger anotherMutableInteger)
Compares two
MutableInteger objects numerically. |
double |
doubleValue() |
boolean |
equals(Object obj)
Compares this object to the specified object.
|
float |
floatValue() |
int |
hashCode() |
void |
incValue(int val)
Add the argument to the value of this integer.
|
int |
intValue() |
long |
longValue() |
void |
set(int i) |
short |
shortValue() |
String |
toString() |
public MutableInteger()
public MutableInteger(int i)
public void set(int i)
public boolean equals(Object obj)
true
if and only if the argument is not
null
and is an MutableInteger
object that
contains the same int
value as this object.
Note that a MutableInteger isn't and can't be equal to an Integer.public int compareTo(MutableInteger anotherMutableInteger)
MutableInteger
objects numerically.compareTo
in interface Comparable<MutableInteger>
anotherMutableInteger
- the MutableInteger
to be
compared.0
if this MutableInteger
is
equal to the argument MutableInteger
; a value less than
0
if this MutableInteger
is numerically less
than the argument MutableInteger
; and a value greater
than 0
if this MutableInteger
is numerically
greater than the argument MutableInteger
(signed
comparison).public short shortValue()
shortValue
in class Number
public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public void incValue(int val)
val
- Value to be added to this integer