public class BigByte extends java.lang.Number implements java.lang.Comparable<BigByte>
Modifier and Type | Field and Description |
---|---|
static int |
MAX_VALUE
The maximum value that a BigByte may represent: 255.
|
static int |
MIN_VALUE
The minimum value that a BigByte may represent: 0.
|
static BigByte |
ZERO |
Constructor and Description |
---|
BigByte(byte value)
Constructs a newly allocated
BigByte object that
represents the specified byte value. |
BigByte(int value)
Constructs a newly allocated
BigByte object that
represents the specified int value. |
BigByte(java.lang.String s)
Constructs a newly allocated
BigByte object that
represents the BigByte value indicated by the
String parameter. |
Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Returns the value of this
BigByte as a
byte . |
static int |
compare(BigByte x,
BigByte y)
Compares two
BigByte values numerically. |
int |
compareTo(BigByte anotherByte)
Compares two
BigByte objects numerically. |
double |
doubleValue()
Returns the value of this
BigByte as a double
after a widening primitive conversion. |
boolean |
equals(java.lang.Object obj)
Compares this object to the specified object.
|
float |
floatValue()
Returns the value of this
BigByte as a float after
a widening primitive conversion. |
int |
hashCode()
Returns a hash code for this
BigByte ; equal to the result
of invoking intValue() . |
int |
intValue()
Returns the value of this
BigByte as an int after
a widening primitive conversion. |
long |
longValue()
Returns the value of this
BigByte as a long after
a widening primitive conversion. |
static BigByte |
parseBigByte(java.lang.String s)
Parses the string argument as an unsigned Integer
BigByte . |
short |
shortValue()
Returns the value of this
BigByte as a short after
a widening primitive conversion. |
java.lang.String |
toString()
Returns a
String object representing this
BigByte 's value. |
static java.lang.String |
toString(BigByte b)
Returns a new
String object representing the
specified BigByte . |
static BigByte |
valueOf(byte b)
Returns a
BigByte instance representing the specified
byte value. |
static BigByte |
valueOf(int b)
Returns a
BigByte instance representing the specified
int value. |
static BigByte |
valueOf(java.lang.String s)
Returns a
BigByte object holding the value
given by the specified String . |
public static final int MIN_VALUE
public static final int MAX_VALUE
public static final BigByte ZERO
public BigByte(byte value)
BigByte
object that
represents the specified byte
value.value
- the value to be represented by the
BigByte
.public BigByte(int value)
BigByte
object that
represents the specified int
value.value
- the value to be represented by the
int
.public BigByte(java.lang.String s)
BigByte
object that
represents the BigByte
value indicated by the
String
parameter. The string is converted to a
BigByte
value in exactly the manner used by the
parseInt
method.s
- the String
to be converted to a
BigByte
java.lang.NumberFormatException
- If the String
does not contain a parsable byte
.public static java.lang.String toString(BigByte b)
String
object representing the
specified BigByte
.b
- the BigByte
to be convertedBigByte
public static BigByte valueOf(byte b)
BigByte
instance representing the specified
byte
value.
If a new BigByte
instance is not required, this method
should generally be used in preference to the constructor
BigByte(byte)
, as this method is likely to yield
significantly better space and time performance since
all byte values are cached.b
- a byte value.BigByte
instance representing b
.public static BigByte valueOf(int b)
BigByte
instance representing the specified
int
value.
If a new BigByte
instance is not required, this method
should generally be used in preference to the constructor
BigByte(int)
, as this method is likely to yield
significantly better space and time performance since
all byte values are cached.b
- a byte value.BigByte
instance representing b
.public static BigByte parseBigByte(java.lang.String s) throws java.lang.NumberFormatException
BigByte
.s
- a String
containing the
BigByte
representation to be parsedBigByte
value represented by the
argument in the stringjava.lang.NumberFormatException
- if the string does not
contain a parsable BigByte
.public static BigByte valueOf(java.lang.String s) throws java.lang.NumberFormatException
BigByte
object holding the value
given by the specified String
.s
- the string to be parsedBigByte
object holding the value
represented by the string argumentjava.lang.NumberFormatException
- If the String
does
not contain a parsable BigByte
.public byte byteValue()
BigByte
as a
byte
.byteValue
in class java.lang.Number
public short shortValue()
BigByte
as a short
after
a widening primitive conversion.shortValue
in class java.lang.Number
public int intValue()
BigByte
as an int
after
a widening primitive conversion.intValue
in class java.lang.Number
public long longValue()
BigByte
as a long
after
a widening primitive conversion.longValue
in class java.lang.Number
public float floatValue()
BigByte
as a float
after
a widening primitive conversion.floatValue
in class java.lang.Number
public double doubleValue()
BigByte
as a double
after a widening primitive conversion.doubleValue
in class java.lang.Number
public java.lang.String toString()
String
object representing this
BigByte
's value.toString
in class java.lang.Object
public int hashCode()
BigByte
; equal to the result
of invoking intValue()
.hashCode
in class java.lang.Object
BigByte
public boolean equals(java.lang.Object obj)
true
if and only if the argument is not
null
and is a BigByte
object that
contains the same int
value as this object.equals
in class java.lang.Object
obj
- the object to compare withtrue
if the objects are the same;
false
otherwise.public int compareTo(BigByte anotherByte)
BigByte
objects numerically.compareTo
in interface java.lang.Comparable<BigByte>
anotherByte
- the BigByte
to be compared.0
if this BigByte
is
equal to the argument BigByte
; a value less than
0
if this BigByte
is numerically less
than the argument BigByte
; and a value greater than
0
if this BigByte
is numerically
greater than the argument BigByte
(signed
comparison).public static int compare(BigByte x, BigByte y)
BigByte
values numerically.
The value returned is identical to what would be returned by:
BigByte.valueOf(x).compareTo(BigByte.valueOf(y))
x
- the first BigByte
to comparey
- the second BigByte
to compare0
if x == y
;
a value less than 0
if x < y
; and
a value greater than 0
if x > y