|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmoka.lang.Object
moka.lang.Byte
The Byte class wraps a value of the primitive type byte
in an object. An object of type Byte
contains a
single field whose type is byte
.
In addition, this class provides several methods for converting
an byte
to a String
and a
String
to an byte
, as well as other
constants and methods useful when dealing with an
byte
.
Field Summary | |
static byte |
MAX_VALUE
The largest value of type byte . |
static byte |
MIN_VALUE
The smallest value of type byte . |
Constructor Summary | |
Byte(byte value)
Constructs a newly allocated Byte object that
represents the primitive byte argument. |
|
Byte(String s)
Constructs a newly allocated Byte object that
represents the value represented by the string. |
Method Summary | |
byte |
byteValue()
Returns the value of this Byte as an
byte . |
double |
doubleValue()
Returns the value of this Byte as a double . |
boolean |
equals(Object obj)
Compares this object to the specified object. |
int |
intValue()
Returns the value of this Byte as an int . |
static boolean |
isByte(String str)
Checks if the specified string is a decimal representation of a byte. |
long |
longValue()
Returns the value of this Byte as a long . |
static byte |
parseByte(String s)
Parses the string argument as a signed decimal integer. |
short |
shortValue()
Returns the value of this Byte as a short . |
String |
toString()
Returns a String object representing this
Byte 's value. |
Methods inherited from class moka.lang.Object |
finalize, getClassName |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte MIN_VALUE
byte
. The constant
value of this field is -128.
public static final byte MAX_VALUE
byte
. The constant
value of this field is 127.
Constructor Detail |
public Byte(byte value)
Byte
object that
represents the primitive byte
argument.
value
- the value to be represented by the Byte
.public Byte(String s)
Byte
object that
represents the value represented by the string. The string is
converted to an byte in exactly the manner used by the
parseByte method.
s
- the String
to be converted to an
Integer
.Method Detail |
public String toString()
String
object representing this
Byte
's value. The value is converted to signed
decimal representation and returned as a string.
toString
in class Object
public boolean equals(Object obj)
true
if and only if the argument is not
null
and is an Byte
object that
contains the same byte
value as this object.
equals
in class Object
obj
- the object to compare with.
true
if the objects are the same;
false
otherwise.public byte byteValue()
Byte
as an
byte
.
public static byte parseByte(String s)
'-'
('\u002D'
) to indicate a negative value. The resulting
byte value is returned. The string argument is finalized before the method
returns.
s
- a String
containing the int
representation to be parsed
public int intValue()
int
.
This may involve rounding or truncation.
int
.public long longValue()
long
.
This may involve rounding or truncation.
long
.public double doubleValue()
double
.
This may involve rounding.
double
.public short shortValue()
short
.
This may involve rounding or truncation.
short
.public static boolean isByte(String str)
str
- The string to verify
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |