java.lang.Object | ||
↳ | java.lang.Number | |
↳ | java.lang.Byte |
The wrapper for the primitive type byte
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
byte | MAX_VALUE | The maximum Byte value, 27-1. |
|||||||||
byte | MIN_VALUE | The minimum Byte value, -27. |
|||||||||
int | SIZE | The number of bits needed to represent a Byte value in two's
complement form. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TYPE | The Class object that represents the primitive type byte . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
Byte with the specified primitive byte value. | |||||||||||
Constructs a new
Byte from the specified string. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the primitive value of this byte.
| |||||||||||
Compares this object to the specified byte object to determine their
relative order.
| |||||||||||
Parses the specified string and returns a
Byte instance if the
string can be decoded into a single byte value. | |||||||||||
Returns this object's value as a double.
| |||||||||||
Compares this object with the specified object and indicates if they are
equal.
| |||||||||||
Returns this object's value as a float.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
Returns this object's value as an int.
| |||||||||||
Returns this object's value as a long.
| |||||||||||
Parses the specified string as a signed byte value using the specified
radix.
| |||||||||||
Parses the specified string as a signed decimal byte value.
| |||||||||||
Returns this object's value as a short.
| |||||||||||
Returns a string containing a concise, human-readable description of the
specified byte value.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Parses the specified string as a signed decimal byte value.
| |||||||||||
Parses the specified string as a signed byte value using the specified
radix.
| |||||||||||
Returns a
Byte instance for the specified byte value. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Number
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Comparable
|
The maximum Byte
value, 27-1.
The minimum Byte
value, -27.
The number of bits needed to represent a Byte
value in two's
complement form.
The Class
object that represents the primitive type byte
.
Constructs a new Byte
with the specified primitive byte value.
value | the primitive byte value to store in the new instance. |
---|
Constructs a new Byte
from the specified string.
string | the string representation of a single byte value. |
---|
NumberFormatException | if string cannot be parsed as a byte value. |
---|
Gets the primitive value of this byte.
Compares this object to the specified byte object to determine their relative order.
object | the byte object to compare this object to. |
---|
object
; 0 if the value of this byte and the value of
object
are equal; a positive value if the value of this
byte is greater than the value of object
.Parses the specified string and returns a Byte
instance if the
string can be decoded into a single byte value. The string may be an
optional minus sign "-" followed by a hexadecimal ("0x..." or "#..."),
octal ("0..."), or decimal ("...") representation of a byte.
string | a string representation of a single byte value. |
---|
Byte
containing the value represented by string
.NumberFormatException | if string cannot be parsed as a byte value.
|
---|
Returns this object's value as a double. Might involve rounding.
Compares this object with the specified object and indicates if they are
equal. In order to be equal, object
must be an instance of
Byte
and have the same byte value as this object.
object | the object to compare this byte with. |
---|
true
if the specified object is equal to this
Byte
; false
otherwise.
Returns this object's value as a float. Might involve rounding.
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct hashCode
method
if you intend implementing your own hashCode
method.
Returns this object's value as an int. Might involve rounding and/or truncating the value, so it fits into an int.
Returns this object's value as a long. Might involve rounding and/or truncating the value, so it fits into a long.
Parses the specified string as a signed byte value using the specified radix. The ASCII character - ('-') is recognized as the minus sign.
string | the string representation of a single byte value. |
---|---|
radix | the radix to use when parsing. |
string
using
radix
.NumberFormatException | if string can not be parsed as a byte value, or
radix < Character.MIN_RADIX ||
radix > Character.MAX_RADIX .
|
---|
Parses the specified string as a signed decimal byte value. The ASCII character - ('-') is recognized as the minus sign.
string | the string representation of a single byte value. |
---|
string
.NumberFormatException | if string can not be parsed as a byte value.
|
---|
Returns this object's value as a short. Might involve rounding and/or truncating the value, so it fits into a short.
Returns a string containing a concise, human-readable description of the specified byte value.
value | the byte to convert to a string. |
---|
value
.
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful toString
method
if you intend implementing your own toString
method.
Parses the specified string as a signed decimal byte value.
string | the string representation of a single byte value. |
---|
Byte
instance containing the byte value represented by
string
.NumberFormatException | if string can not be parsed as a byte value. |
---|
Parses the specified string as a signed byte value using the specified radix.
string | the string representation of a single byte value. |
---|---|
radix | the radix to use when parsing. |
Byte
instance containing the byte value represented by
string
using radix
.NumberFormatException | if string can not be parsed as a byte value, or
radix < Character.MIN_RADIX ||
radix > Character.MAX_RADIX . |
---|
Returns a Byte
instance for the specified byte value.
If it is not necessary to get a new Byte
instance, it is
recommended to use this method instead of the constructor, since it
maintains a cache of instances which may result in better performance.
b | the byte value to store in the instance. |
---|
Byte
instance containing b
.