|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
java.lang.Byte
public final class Byte
Byte is the wrapper for the primitive type byte.
| Field Summary | |
|---|---|
static byte |
MAX_VALUE
Constant for the maximum byte value, 27-1. |
static byte |
MIN_VALUE
Constant for the minimum byte value, -27. |
static int |
SIZE
Constant for the number of bits to represent a byte in
two's compliment form. |
static Class<Byte> |
TYPE
The java.lang.Class that represents this class. |
| Constructor Summary | |
|---|---|
Byte(byte value)
Constructs a new instance of the receiver which represents the byte valued argument. |
|
Byte(String string)
Constructs a new instance of this class given a string. |
|
| Method Summary | |
|---|---|
byte |
byteValue()
Returns the byte value which the receiver represents |
int |
compareTo(Byte object)
Compares this Byte to the Byte passed. |
static Byte |
decode(String string)
Parses the string argument as if it was a byte value and returns the result. |
double |
doubleValue()
Returns the double value which the receiver represents |
boolean |
equals(Object object)
Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison. |
float |
floatValue()
Returns the float value which the receiver represents |
int |
hashCode()
Returns an integer hash code for the receiver. |
int |
intValue()
Returns the int value which the receiver represents |
long |
longValue()
Returns the long value which the receiver represents |
static byte |
parseByte(String string)
Parses the string argument as if it was a byte value and returns the result. |
static byte |
parseByte(String string,
int radix)
Parses the string argument as if it was a byte value and returns the result. |
short |
shortValue()
Returns the short value which the receiver represents |
String |
toString()
Returns a string containing a concise, human-readable description of the receiver. |
static String |
toString(byte value)
Returns a string containing a concise, human-readable description of the argument. |
static Byte |
valueOf(byte b)
Returns a Byte instance for the byte value passed. |
static Byte |
valueOf(String string)
Parses the string argument as if it was a byte value and returns a Byte representing the result. |
static Byte |
valueOf(String string,
int radix)
Parses the string argument as if it was a byte value and returns a Byte representing the result. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final byte MAX_VALUE
Constant for the maximum byte value, 27-1.
public static final byte MIN_VALUE
Constant for the minimum byte value, -27.
public static final int SIZE
Constant for the number of bits to represent a byte in
two's compliment form.
public static final Class<Byte> TYPE
| Constructor Detail |
|---|
public Byte(byte value)
value - the byte to store in the new instance.
public Byte(String string)
throws NumberFormatException
string - a string representation of a single byte quantity.
NumberFormatException - if the argument could not be parsed as a byte quantity.| Method Detail |
|---|
public byte byteValue()
byteValue in class Numberpublic int compareTo(Byte object)
Compares this Byte to the Byte passed. If
this instance's value is equal to the value of the instance passed, then
0 is returned. If this instance's value is less than the value of the
instance passed, then a negative value is returned. If this instance's
value is greater than the value of the instance passed, then a positive
value is returned.
compareTo in interface Comparable<Byte>object - The instance to compare to.
NullPointerException - if object is
null.
public static Byte decode(String string)
throws NumberFormatException
string - a string representation of a single byte quantity.
NumberFormatException - if the argument could not be parsed as a byte quantity.public double doubleValue()
doubleValue in class Numberpublic boolean equals(Object object)
In this case, the argument must also be a Byte, and the receiver and argument must represent the same byte value.
equals in class Objectobject - the object to compare with this object
true if the object is the same as this object
false if it is different from this objecthashCode()public float floatValue()
floatValue in class Numberpublic int hashCode()
true when passed to equals must
answer the same value for this method.
hashCode in class Objectequals(java.lang.Object)public int intValue()
intValue in class Numberpublic long longValue()
longValue in class Number
public static byte parseByte(String string)
throws NumberFormatException
string - a string representation of a single byte quantity.
NumberFormatException - if the argument could not be parsed as a byte quantity.
public static byte parseByte(String string,
int radix)
throws NumberFormatException
string - a string representation of a single byte quantity.radix - the radix to use when parsing.
NumberFormatException - if the argument could not be parsed as a byte quantity.public short shortValue()
shortValue in class Numberpublic String toString()
toString in class Objectpublic static String toString(byte value)
value - byte the byte to convert.
public static Byte valueOf(String string)
throws NumberFormatException
string - a string representation of a single byte quantity.
NumberFormatException - if the argument could not be parsed as a byte quantity.
public static Byte valueOf(String string,
int radix)
throws NumberFormatException
string - a string representation of a single byte quantity.radix - the radix to use when parsing.
NumberFormatException - if the argument could not be parsed as a byte quantity.public static Byte valueOf(byte b)
Returns a Byte instance for the byte value passed.
This method is preferred over the constructor, as this method may maintain a cache
of instances.
b - The byte value.
Byte instance.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||