javax.cim
Class UnsignedInteger8

java.lang.Object
  extended by java.lang.Number
      extended by javax.cim.UnsignedInteger8
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<UnsignedInteger8>

public class UnsignedInteger8
extends java.lang.Number
implements java.lang.Comparable<UnsignedInteger8>

The UnsignedInteger8 class wraps the value of an uint8. This class was created to represent an uint8 data type as defined by the CIM Infrastructure Specification. The specification is available from the DMTF (Distributed Management Task Force) at http://dmtf.org/

See Also:
Serialized Form

Field Summary
static short MAX_VALUE
          The maximum possible value for an UnsignedInteger8.
static short MIN_VALUE
          The minimum possible value for an UnsignedInteger8.
 
Constructor Summary
UnsignedInteger8(short pValue)
          Constructs an unsigned 8-bit integer object for the specified short value.
UnsignedInteger8(java.lang.String pValue)
          Constructs an unsigned 8-bit integer object for the specified string.
 
Method Summary
 byte byteValue()
          Returns the value of this unsigned integer object as a byte.
 int compareTo(UnsignedInteger8 pOther)
          Compares this UnsignedInteger8 with the specified UnsignedInteger8.
 double doubleValue()
          doubleValue
 boolean equals(java.lang.Object pObj)
           
 float floatValue()
          floatValue
 int intValue()
          intValue
 long longValue()
          Returns the value of this unsigned integer object as a long.
 short shortValue()
          Returns the value of this unsigned integer object as a short.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_VALUE

public static final short MAX_VALUE
The maximum possible value for an UnsignedInteger8.

See Also:
Constant Field Values

MIN_VALUE

public static final short MIN_VALUE
The minimum possible value for an UnsignedInteger8.

See Also:
Constant Field Values
Constructor Detail

UnsignedInteger8

public UnsignedInteger8(short pValue)
                 throws java.lang.NumberFormatException
Constructs an unsigned 8-bit integer object for the specified short value. Only the lower 8 bits are considered.

Parameters:
pValue - - the short to be represented as an unsigned 8-bit integer object.
Throws:
java.lang.NumberFormatException - - if the number is out of range.

UnsignedInteger8

public UnsignedInteger8(java.lang.String pValue)
                 throws java.lang.NumberFormatException
Constructs an unsigned 8-bit integer object for the specified string. Only the lower 8 bits are considered.

Parameters:
pValue - - the string to be represented as an unsigned 8-bit integer.
Throws:
java.lang.NumberFormatException - - if the number is out of range.
Method Detail

equals

public boolean equals(java.lang.Object pObj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

byteValue

public byte byteValue()
Returns the value of this unsigned integer object as a byte.

Overrides:
byteValue in class java.lang.Number
Returns:
the byte value of this unsigned integer object

shortValue

public short shortValue()
Returns the value of this unsigned integer object as a short.

Overrides:
shortValue in class java.lang.Number
Returns:
value of this unsigned integer object as a short

longValue

public long longValue()
Returns the value of this unsigned integer object as a long.

Specified by:
longValue in class java.lang.Number
Returns:
Value of this unsigned integer object as a long.

doubleValue

public double doubleValue()
doubleValue

Specified by:
doubleValue in class java.lang.Number
Returns:
double

floatValue

public float floatValue()
floatValue

Specified by:
floatValue in class java.lang.Number
Returns:
float

intValue

public int intValue()
intValue

Specified by:
intValue in class java.lang.Number
Returns:
int

compareTo

public int compareTo(UnsignedInteger8 pOther)
Compares this UnsignedInteger8 with the specified UnsignedInteger8. This method is provided in preference to individual methods for each of the six boolean comparison operators (<, ==, >, >=, !=, <=). The suggested idiom for performing these comparisons is: (x.compareTo(y) <op> 0), where <op> is one of the six comparison operators.

Specified by:
compareTo in interface java.lang.Comparable<UnsignedInteger8>
Parameters:
pOther - - Object to which this UnsignedInteger8 is to be compared. Throws a ClassCastException if the input object is not an UnsignedInteger8.
Returns:
-1, 0 or 1 as this UnsignedInteger8 is numerically less than, equal to, or greater than val.
See Also:
Comparable.compareTo(Object o)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2005, 2009 IBM Corporation. All Rights Reserved.