org.jooq.tools.unsigned
Class UByte

java.lang.Object
  extended by java.lang.Number
      extended by org.jooq.tools.unsigned.UNumber
          extended by org.jooq.tools.unsigned.UByte
All Implemented Interfaces:
Serializable, Comparable<UByte>

public final class UByte
extends UNumber
implements Comparable<UByte>

The unsigned byte type

Author:
Lukas Eder, Ed Schaller
See Also:
Serialized Form

Field Summary
static short MAX_VALUE
          A constant holding the maximum value an unsigned byte can have, 28-1.
static short MIN_VALUE
          A constant holding the minimum value an unsigned byte can have, 0.
 
Constructor Summary
UByte(byte value)
          Deprecated. - Use valueOf(byte), or Unsigned.ubyte(byte) instead
UByte(int value)
          Deprecated. - Use valueOf(int), or Unsigned.ubyte(int) instead
UByte(long value)
          Deprecated. - Use valueOf(long), or Unsigned.ubyte(long) instead
UByte(short value)
          Deprecated. - Use valueOf(short), or Unsigned.ubyte(short) instead
UByte(String value)
          Deprecated. - Use valueOf(String), or Unsigned.ubyte(String) instead
 
Method Summary
 int compareTo(UByte o)
           
 double doubleValue()
           
 boolean equals(Object obj)
           
 float floatValue()
           
 int hashCode()
           
 int intValue()
           
 long longValue()
           
 BigInteger toBigInteger()
          Get this number as a BigInteger.
 String toString()
           
static UByte valueOf(byte value)
          Get an instance of an unsigned byte by masking it with 0xFF i.e.
static UByte valueOf(int value)
          Get an instance of an unsigned byte
static UByte valueOf(long value)
          Get an instance of an unsigned byte
static UByte valueOf(short value)
          Get an instance of an unsigned byte
static UByte valueOf(String value)
          Get an instance of an unsigned byte
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_VALUE

public static final short MIN_VALUE
A constant holding the minimum value an unsigned byte can have, 0.

See Also:
Constant Field Values

MAX_VALUE

public static final short MAX_VALUE
A constant holding the maximum value an unsigned byte can have, 28-1.

See Also:
Constant Field Values
Constructor Detail

UByte

@Deprecated
public UByte(long value)
      throws NumberFormatException
Deprecated. - Use valueOf(long), or Unsigned.ubyte(long) instead

Create an unsigned byte

Throws:
NumberFormatException - If value is not in the range of an unsigned byte

UByte

@Deprecated
public UByte(int value)
      throws NumberFormatException
Deprecated. - Use valueOf(int), or Unsigned.ubyte(int) instead

Create an unsigned byte

Throws:
NumberFormatException - If value is not in the range of an unsigned byte

UByte

@Deprecated
public UByte(short value)
      throws NumberFormatException
Deprecated. - Use valueOf(short), or Unsigned.ubyte(short) instead

Create an unsigned byte

Throws:
NumberFormatException - If value is not in the range of an unsigned byte

UByte

@Deprecated
public UByte(byte value)
Deprecated. - Use valueOf(byte), or Unsigned.ubyte(byte) instead

Create an unsigned byte by masking it with 0xFF i.e. (byte) -1 becomes (ubyte) 255


UByte

@Deprecated
public UByte(String value)
      throws NumberFormatException
Deprecated. - Use valueOf(String), or Unsigned.ubyte(String) instead

Create an unsigned byte

Throws:
NumberFormatException - If value does not contain a parsable unsigned byte.
Method Detail

valueOf

public static UByte valueOf(String value)
                     throws NumberFormatException
Get an instance of an unsigned byte

Throws:
NumberFormatException - If value does not contain a parsable unsigned byte.

valueOf

public static UByte valueOf(byte value)
Get an instance of an unsigned byte by masking it with 0xFF i.e. (byte) -1 becomes (ubyte) 255


valueOf

public static UByte valueOf(short value)
                     throws NumberFormatException
Get an instance of an unsigned byte

Throws:
NumberFormatException - If value is not in the range of an unsigned byte

valueOf

public static UByte valueOf(int value)
                     throws NumberFormatException
Get an instance of an unsigned byte

Throws:
NumberFormatException - If value is not in the range of an unsigned byte

valueOf

public static UByte valueOf(long value)
                     throws NumberFormatException
Get an instance of an unsigned byte

Throws:
NumberFormatException - If value is not in the range of an unsigned byte

intValue

public int intValue()
Specified by:
intValue in class Number

longValue

public long longValue()
Specified by:
longValue in class Number

floatValue

public float floatValue()
Specified by:
floatValue in class Number

doubleValue

public double doubleValue()
Specified by:
doubleValue in class Number

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(UByte o)
Specified by:
compareTo in interface Comparable<UByte>

toBigInteger

public BigInteger toBigInteger()
Description copied from class: UNumber
Get this number as a BigInteger. This is a convenience method for calling new BigInteger(toString())

Overrides:
toBigInteger in class UNumber


Copyright © 2012. All Rights Reserved.