站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

MuShort (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util
Class MuShort

java.lang.Object
  extended byjava.lang.Number
      extended byorg.jboss.util.MuNumber
          extended byorg.jboss.util.MuShort
All Implemented Interfaces:
Cloneable, Comparable, Mutable, Serializable

public class MuShort
extends MuNumber

A mutable short class.

Version:
$Revision: 1.1 $
Author:
Jason Dillon
See Also:
Serialized Form

Constructor Summary
MuShort()
          Construct a new mutable short integer.
MuShort(Object obj)
          Construct a new mutable short integer.
MuShort(short s)
          Construct a new mutable short integer.
 
Method Summary
 short add(short amount)
          Add the specified amount.
 short and(short 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 short.
 boolean commit(short assumed, short b)
          Set the value to value only if the current value is equal to the assumed value.
 int compareTo(Object obj)
          Compares this object with the specified object for order.
 int compareTo(short other)
          Compares this object with the specified short for order.
 short complement()
          Set the value to its complement.
 short decrement()
          Decrement the value of this mutable short.
 short divide(short 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 short integer and another object.
 float floatValue()
          Return the float value of this object.
 short get()
          Get the current value.
 Object getValue()
          Return the value of this mutable short integer.
 int hashCode()
          Get the hash code for this mutable short integer.
 short increment()
          Increment the value of this mutable short.
 int intValue()
          Return the int value of this object.
 long longValue()
          Return the long value of this object.
 short multiply(short factor)
          Multiply by the specified factor.
 short negate()
          Set the value to the negative of its current value.
 short or(short b)
          ORs the current value with the specified value.
 short set(short s)
          Set the value.
 void setValue(Object obj)
          Set the value of this mutable short integer.
 short shiftLeft(int bits)
          Shift the current value to the left.
 short shiftRight(int bits)
          Shift the current value to the right.
 short shiftRightZero(int bits)
          Shift the current value to the right with a zero extension.
 short shortValue()
          Return the short value of this object.
 short subtract(short amount)
          Subtract the specified amount.
 short swap(MuShort b)
          Swap values with another mutable short.
 String toString()
          Convert this mutable short integer to a string.
 short xor(short 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

MuShort

public MuShort()
Construct a new mutable short integer.


MuShort

public MuShort(short s)
Construct a new mutable short integer.

Parameters:
s - Short value.

MuShort

public MuShort(Object obj)
Construct a new mutable short integer.

Parameters:
obj - Object to convert to a short value.
Method Detail

set

public short set(short s)
Set the value.

Parameters:
s - short value.
Returns:
The previous value.

get

public short get()
Get the current value.

Returns:
The current value.

commit

public boolean commit(short assumed,
                      short b)
Set the value to value only if the current value is equal to the assumed value.

Parameters:
assumed - The assumed value.
b - The new value.
Returns:
True if value was changed.

swap

public short swap(MuShort b)
Swap values with another mutable short.

Parameters:
b - Mutable short to swap values with.
Returns:
The new value.

increment

public short increment()
Increment the value of this mutable short.

Returns:
Short value.

decrement

public short decrement()
Decrement the value of this mutable short.

Returns:
Short value.

add

public short add(short amount)
Add the specified amount.

Parameters:
amount - Amount to add.
Returns:
The new value.

subtract

public short subtract(short amount)
Subtract the specified amount.

Parameters:
amount - Amount to subtract.
Returns:
The new value.

multiply

public short multiply(short factor)
Multiply by the specified factor.

Parameters:
factor - Factor to multiply by.
Returns:
The new value.

divide

public short divide(short factor)
Divide by the specified factor.

Parameters:
factor - Factor to divide by.
Returns:
The new value.

negate

public short negate()
Set the value to the negative of its current value.

Returns:
The new value.

complement

public short complement()
Set the value to its complement.

Returns:
The new value.

and

public short and(short b)
ANDs the current value with the specified value.

Parameters:
b - Value to and with.
Returns:
The new value.

or

public short or(short b)
ORs the current value with the specified value.

Parameters:
b - Value to or with.
Returns:
The new value.

xor

public short xor(short b)
XORs the current value with the specified value.

Parameters:
b - Value to xor with.
Returns:
The new value.

shiftRight

public short shiftRight(int bits)
Shift the current value to the right.

Parameters:
bits - The number of bits to shift.
Returns:
The new value.

shiftRightZero

public short shiftRightZero(int bits)
Shift the current value to the right with a zero extension.

Parameters:
bits - The number of bits to shift.
Returns:
The new value.

shiftLeft

public short shiftLeft(int bits)
Shift the current value to the left.

Parameters:
bits - The number of bits to shift.
Returns:
The new value.

compareTo

public int compareTo(short other)
Compares this object with the specified short for order.

Parameters:
other - Value to compare with.
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

compareTo

public int compareTo(Object obj)
Compares this object with the specified object for order.

Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - Object is not a MuShort.

toString

public String toString()
Convert this mutable short integer to a string.

Returns:
String value.

hashCode

public int hashCode()
Get the hash code for this mutable short integer.

Returns:
Hash code.

equals

public boolean equals(Object obj)
Test the equality of this mutable short integer and another object.

Parameters:
obj - Object to test equality with.
Returns:
True if object is equal.

clone

public Object clone()
Return a cloned copy of this mutable short.

Returns:
Cloaned mutable short.

byteValue

public byte byteValue()
Return the byte value of this object.

Overrides:
byteValue in class MuNumber
Returns:
byte value.

shortValue

public short shortValue()
Return the short value of this object.

Overrides:
shortValue in class MuNumber
Returns:
short value.

intValue

public int intValue()
Return the int value of this object.

Overrides:
intValue in class MuNumber
Returns:
int value.

longValue

public long longValue()
Return the long value of this object.

Returns:
long value.

floatValue

public float floatValue()
Return the float value of this object.

Overrides:
floatValue in class MuNumber
Returns:
float value.

doubleValue

public double doubleValue()
Return the double value of this object.

Returns:
double value.

setValue

public void setValue(Object obj)
Set the value of this mutable short integer.

Parameters:
obj - Object to convert to a short value.
Throws:
NotCoercibleException - Can not convert to short.

getValue

public Object getValue()
Return the value of this mutable short integer.

Returns:
java.lang.Short value.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.