|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
org.jboss.util.MuNumber (src)
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(java.lang.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. |
java.lang.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(java.lang.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(java.lang.Object obj)
Test the equality of this mutable integer and another object. |
float |
floatValue()
Return the float value of this object. |
java.lang.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(java.lang.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 (src) i)
Swap values with another mutable integer. |
java.lang.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(java.lang.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 (src) 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(java.lang.Object obj)
java.lang.ClassCastException
- Object is not a MuInteger.public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object obj)
obj
- Qbject to test equality with.
public java.lang.Object clone()
public byte byteValue()
byte
value of this object.
byteValue
in class MuNumber (src)
byte
value.public short shortValue()
short
value of this object.
shortValue
in class MuNumber (src)
short
value.public int intValue()
int
value of this object.
intValue
in class MuNumber (src)
int
value.public long longValue()
long
value of this object.
long
value.public float floatValue()
float
value of this object.
floatValue
in class MuNumber (src)
float
value.public double doubleValue()
double
value of this object.
double
value.public void setValue(java.lang.Object obj)
obj
- Target value for object.
NotCoercibleException (src)
- Can not convert to int
.public java.lang.Object getValue()
java.lang.Integer
value.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |