|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Number org.jboss.util.MuNumber org.jboss.util.MuInteger
A mutable integer class.
Constructor Summary | |
MuInteger()
Construct a new mutable integer. |
|
MuInteger(int i)
Construct a new mutable integer. |
|
MuInteger(Object obj)
Construct a new mutable integer. |
Method Summary | |
int |
add(int amount)
Add the specified amount. |
int |
and(int b)
ANDs the current value with the specified value. |
byte |
byteValue()
Return the byte value of this object. |
Object |
clone()
Return a cloned copy of this mutable integer. |
boolean |
commit(int assumed,
int i)
Set the value to value only if the current value is equal to the assumed value. |
int |
compareTo(int other)
Compares this object with the specified int for order. |
int |
compareTo(Object obj)
Compares this object with the specified object for order. |
int |
complement()
Set the value to its complement. |
int |
decrement()
Decrement the value of this mutable integer. |
int |
divide(int factor)
Divide by the specified factor. |
double |
doubleValue()
Return the double value of this object. |
boolean |
equals(Object obj)
Test the equality of this mutable integer and another object. |
float |
floatValue()
Return the float value of this object. |
Object |
getValue()
Get the value of this mutable integer. |
int |
hashCode()
Get the hash code for this mutable integer. |
int |
increment()
Increment the value of this mutable integer. |
int |
intValue()
Return the int value of this object. |
long |
longValue()
Return the long value of this object. |
int |
multiply(int factor)
Multiply by the specified factor. |
int |
negate()
Set the value to the negative of its current value. |
int |
or(int b)
ORs the current value with the specified value. |
void |
setValue(Object obj)
Set the value of this mutable integer. |
int |
shiftLeft(int bits)
Shift the current value to the left. |
int |
shiftRight(int bits)
Shift the current value to the right. |
int |
shiftRightZero(int bits)
Shift the current value to the right with a zero extension. |
short |
shortValue()
Return the short value of this object. |
int |
subtract(int amount)
Subtract the specified amount. |
int |
swap(MuInteger i)
Swap values with another mutable integer. |
String |
toString()
Convert this mutable integer to a string. |
int |
xor(int b)
XORs the current value with the specified value. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MuInteger()
public MuInteger(int i)
i
- Integer value.public MuInteger(Object obj)
obj
- Object to convert to a int
value.Method Detail |
public boolean commit(int assumed, int i)
assumed
- The assumed value.i
- The new value.
public int swap(MuInteger i)
i
- Mutable integer to swap values with.
public int increment()
public int decrement()
public int add(int amount)
amount
- Amount to add.
public int subtract(int amount)
amount
- Amount to subtract.
public int multiply(int factor)
factor
- Factor to multiply by.
public int divide(int factor)
factor
- Factor to divide by.
public int negate()
public int complement()
public int and(int b)
b
- Value to and with.
public int or(int b)
b
- Value to or with.
public int xor(int b)
b
- Value to xor with.
public int shiftRight(int bits)
bits
- The number of bits to shift.
public int shiftRightZero(int bits)
bits
- The number of bits to shift.
public int shiftLeft(int bits)
bits
- The number of bits to shift.
public int compareTo(int other)
other
- Value to compare with.
public int compareTo(Object obj)
ClassCastException
- Object is not a MuInteger.public String toString()
public int hashCode()
public boolean equals(Object obj)
obj
- Qbject to test equality with.
public Object clone()
public byte byteValue()
public short shortValue()
short
value of this object.
shortValue
in class MuNumber
short
value.public int intValue()
public long longValue()
long
value of this object.
long
value.public float floatValue()
float
value of this object.
floatValue
in class MuNumber
float
value.public double doubleValue()
double
value of this object.
double
value.public void setValue(Object obj)
obj
- Target value for object.
NotCoercibleException
- Can not convert to int
.public Object getValue()
java.lang.Integer
value.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |