|
![]() |
|||||||||
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 provides a class for byte values stored in objects.
Field Summary | |
---|---|
static byte |
MAX_VALUE
The largest value a byte can hold. |
static byte |
MIN_VALUE
The smallest value a byte can hold. |
static int |
SIZE
The size occupied by one byte in bits. |
static Class<Byte> |
TYPE
type for byte. |
Constructor Summary | |
---|---|
Byte(byte value)
Constructor to create an instance of Byte with the given byte value. |
|
Byte(String s)
Constructor to create an instance of Byte with the value provided as a string. |
Method Summary | |
---|---|
byte |
byteValue()
byteValue returns the value of this as a byte. |
int |
compareTo(Byte o)
compareTo compares this to another byte value |
static Byte |
decode(String s)
decode decodes a string containing decimal, hexadecimal or octal representation of a byte. |
double |
doubleValue()
doubleValue returns the value of this as a short. |
boolean |
equals(Object obj)
equals checks if this and obj represent the same value. |
float |
floatValue()
floatValue returns the value of this as a short. |
int |
hashCode()
hashCode returns a hashCode for this Byte. |
int |
intValue()
intValue returns the value of this as a short. |
long |
longValue()
longValue returns the value of this as a short. |
static byte |
parseByte(String s)
parseByte parse a string that contains the decimal representation of a byte and returns the byte's value. |
static byte |
parseByte(String s,
int radix)
parseByte parses a string that contains a byte represented by a number using the given radix. |
short |
shortValue()
shortValue returns the value of this as a short. |
String |
toString()
toString converts the value of this byte to a decimal string. |
static String |
toString(byte b)
toString creates a decimal string from the given byte value. |
static Byte |
valueOf(byte b)
valueOf returns a byte instance with the given value. |
static Byte |
valueOf(String s)
valueOf returns a byte instance with the value given as a decimal string. |
static Byte |
valueOf(String s,
int radix)
valueOf returns a byte instance with the value given as a string with given radix. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte MIN_VALUE
public static final byte MAX_VALUE
public static final int SIZE
public static final Class<Byte> TYPE
Constructor Detail |
---|
public Byte(byte value)
value
- the value for this instance.public Byte(String s) throws NumberFormatException
s
- the string representation of the value.
NumberFormatException
- if s could not be parsed as a byte.Method Detail |
---|
public static Byte valueOf(byte b)
b
- the byte value
public static String toString(byte b)
b
- the byte value
public static byte parseByte(String s) throws NumberFormatException
s
- the string, e.g, "-128", "3", "127".
NumberFormatException
- if s is not parsable or out of
the legal range for bytes.public static byte parseByte(String s, int radix) throws NumberFormatException
s
- the stringradix
- the radix
NumberFormatException
- if s is not parsable, radix is
out of the legal range or the value is out of the legal range
for bytes.public static Byte valueOf(String s, int radix) throws NumberFormatException
s
- the stringradix
- the radix
NumberFormatException
- if s is not parsable, radix is
out of the legal range or the value is out of the legal range
for bytes.public static Byte valueOf(String s) throws NumberFormatException
s
- the string, e.g, "-128", "3", "127".
NumberFormatException
- if s is not parsable or the value
is out of the legal range for bytes.public static Byte decode(String s) throws NumberFormatException
s
- the string representation, e.g. "0x7f", "-0X80", "-#3F",
"-0100", "123"
NumberFormatException
- if s is not parsable or the value
is out of the legal range for bytes.public byte byteValue()
byteValue
in class Number
public short shortValue()
shortValue
in class Number
public int intValue()
intValue
in class Number
public long longValue()
longValue
in class Number
public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- another object
public int compareTo(Byte o)
compareTo
in interface Comparable<Byte>
o
- the other byte
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |