javax.cim
Class UnsignedInteger8

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

public class UnsignedInteger8
extends Number
implements Serializable, Comparable

This class represents an uint8 as defined by the Distributed Management Task Force (DMTF) CIM Infrastructure Specification (DSP004).

Since:
JSR48 1.0.0
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 value)
          Constructs an unsigned 8-bit integer object for the specified short value.
UnsignedInteger8(String value)
          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(Object val)
          Compares this UnsignedInt8 with the specified UnsignedInt8.
 double doubleValue()
          Returns the value of this unsigned integer object as a double
 boolean equals(Object o)
          Compares this object against the specified object.
 float floatValue()
          Returns the value of this unsigned integer object as a float
 int hashCode()
          Computes the hash code for this unsigned integer object
 int intValue()
          Returns the value of this unsigned integer object as an int
 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
 String toString()
          Returns the text representation of this unsigned integer object
 
Methods inherited from class java.lang.Object
getClass, 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 value)
Constructs an unsigned 8-bit integer object for the specified short value. Only the lower 8 bits are considered.

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

UnsignedInteger8

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

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

compareTo

public int compareTo(Object val)
Compares this UnsignedInt8 with the specified UnsignedInt8. 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 Comparable
Parameters:
val - Object to which this UnsignedInt8 is to be compared. Throws a ClassCastException if the input object is not an UnsignedInt8.
Returns:
-1, 0 or 1 as this UnsignedInt8 is numerically less than, equal to, or greater than val.

equals

public boolean equals(Object o)
Compares this object against the specified object. The result is true if and only if the argument is not null and is an UnsignedInteger8 object that represents the same value as this object.

Parameters:
o - the object to compare.
Returns:
true if the objects are the same; false otherwise.

byteValue

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

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

doubleValue

public double doubleValue()
Returns the value of this unsigned integer object as a double

Specified by:
doubleValue in class Number
Returns:
value of this unsigned integer object as a double

floatValue

public float floatValue()
Returns the value of this unsigned integer object as a float

Specified by:
floatValue in class Number
Returns:
value of this unsigned integer object as a float

hashCode

public int hashCode()
Computes the hash code for this unsigned integer object

Overrides:
hashCode in class Object
Returns:
the integer representing the hash code for this unsigned integer object

intValue

public int intValue()
Returns the value of this unsigned integer object as an int

Specified by:
intValue in class Number
Returns:
value of this unsigned integer object as an int

longValue

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

Specified by:
longValue in class Number
Returns:
value of this unsigned integer object as a long

shortValue

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

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

toString

public String toString()
Returns the text representation of this unsigned integer object

Overrides:
toString in class Object
Returns:
text representation of this unsigned integer


Copyright © 2002-2007 WBEM Solutions, Inc. All Rights Reserved.