|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
org.openmali.types.primitives.MutableByte
public class MutableByte
This a mutable derivation of the Byte class.
Most of the code is borrowed from the Byte class.
| Constructor Summary | |
|---|---|
MutableByte(byte value)
Constructs a newly allocated MutableByte object that
represents the specified byte value. |
|
MutableByte(java.lang.String s)
Constructs a newly allocated MutableByte object that
represents the byte value indicated by the
String parameter. |
|
| Method Summary | |
|---|---|
byte |
byteValue()
Returns the value of this MutableByte as a
byte. |
int |
compareTo(MutableByte anotherByte)
Compares two MutableByte objects numerically. |
double |
doubleValue()
Returns the value of this MutableByte as a
double. |
boolean |
equals(java.lang.Object obj)
Compares this object to the specified object. |
float |
floatValue()
Returns the value of this MutableByte as a
float. |
int |
hashCode()
Returns a hash code for this MutableByte. |
int |
intValue()
Returns the value of this MutableByte as an
int. |
long |
longValue()
Returns the value of this MutableByte as a
long. |
void |
setValue(byte value)
|
short |
shortValue()
Returns the value of this MutableByte as a
short. |
java.lang.String |
toString()
Returns a String object representing this
MutableByte's value. |
static MutableByte |
valueOf(byte b)
Returns a MutableByte instance representing the specified byte value. |
static MutableByte |
valueOf(java.lang.String s)
Returns a MutableByte object holding the value
given by the specified String. |
static MutableByte |
valueOf(java.lang.String s,
int radix)
Returns a MutableByte object holding the value
extracted from the specified String when parsed
with the radix given by the second argument. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MutableByte(byte value)
MutableByte object that
represents the specified byte value.
value - the value to be represented by the
MutableByte.
public MutableByte(java.lang.String s)
throws java.lang.NumberFormatException
MutableByte object that
represents the byte value indicated by the
String parameter. The string is converted to a
byte value in exactly the manner used by the
parseByte method for radix 10.
s - the String to be converted to a
MutableByte
java.lang.NumberFormatException - If the String
does not contain a parsable byte.Byte.parseByte(java.lang.String, int)| Method Detail |
|---|
public final void setValue(byte value)
public final byte byteValue()
MutableByte as a
byte.
byteValue in class java.lang.Numberpublic final short shortValue()
MutableByte as a
short.
shortValue in class java.lang.Numberpublic final int intValue()
MutableByte as an
int.
intValue in class java.lang.Numberpublic final long longValue()
MutableByte as a
long.
longValue in class java.lang.Numberpublic float floatValue()
MutableByte as a
float.
floatValue in class java.lang.Numberpublic double doubleValue()
MutableByte as a
double.
doubleValue in class java.lang.Numberpublic java.lang.String toString()
String object representing this
MutableByte's value. The value is converted to signed
decimal representation and returned as a string, exactly as if
the byte value were given as an argument to the
Byte.toString(byte) method.
toString in class java.lang.Objectpublic int hashCode()
MutableByte.
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
true if and only if the argument is not
null and is a MutableByte object that
contains the same byte value as this object.
equals in class java.lang.Objectobj - the object to compare with
true if the objects are the same;
false otherwise.public int compareTo(MutableByte anotherByte)
MutableByte objects numerically.
compareTo in interface java.lang.Comparable<MutableByte>anotherByte - the MutableByte to be compared.
0 if this MutableByte is
equal to the argument MutableByte; a value less than
0 if this MutableByte is numerically less
than the argument MutableByte; and a value greater than
0 if this MutableByte is numerically
greater than the argument MutableByte (signed
comparison).public static MutableByte valueOf(byte b)
MutableByte(byte), as this method is likely to yield
significantly better space and time performance by caching
frequently requested values.
b - a byte value.
public static MutableByte valueOf(java.lang.String s,
int radix)
throws java.lang.NumberFormatException
MutableByte object holding the value
extracted from the specified String when parsed
with the radix given by the second argument. The first argument
is interpreted as representing a signed byte in
the radix specified by the second argument, exactly as if the
argument were given to the Boolean.parseBoolean(String)
method. The result is a MutableByte object that
represents the byte value specified by the string.
In other words, this method returns a MutableByte object
equal to the value of:
new MutableByte(Byte.parseByte(s, radix))
s - the string to be parsedradix - the radix to be used in interpreting s
MutableByte object holding the value
represented by the string argument in the
specified radix.
java.lang.NumberFormatException - If the String does
not contain a parsable byte.
public static MutableByte valueOf(java.lang.String s)
throws java.lang.NumberFormatException
MutableByte object holding the value
given by the specified String. The argument is
interpreted as representing a signed decimal byte,
exactly as if the argument were given to the Boolean.parseBoolean(String) method. The result is a
MutableByte object that represents the byte
value specified by the string. In other words, this method
returns a MutableByte object equal to the value of:
new MutableByte(Byte.parseByte(s))
s - the string to be parsed
MutableByte object holding the value
represented by the string argument
java.lang.NumberFormatException - If the String does
not contain a parsable byte.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||