|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.XObject
edu.neu.ccs.XNumber
edu.neu.ccs.XByte
Object wrapper for the primitive
byte type that also provides
capabilities.
The default value for this class is
the Stringablebyte representation of zero.
| Field Summary | |
private byte |
value
The wrapped value of this object. |
| Fields inherited from class edu.neu.ccs.XObject |
changeAdapter, VALUE |
| Constructor Summary | |
XByte()
Constructs a wrapper for the default byte value. |
|
XByte(byte b)
Constructs a wrapper for the given byte value. |
|
XByte(String s)
Constructs a wrapper for the byte value
whose state information is encapsulated
in the given String data. |
|
| Method Summary | |
byte |
byteValue()
Returns the value of this number as a byte value. |
double |
doubleValue()
Returns the value of this number as a double value. |
boolean |
equals(Object other)
Returns true if the wrapped object
is equal to the given object, and false
if it is not. |
float |
floatValue()
Returns the value of this number as a float value. |
void |
fromStringData(String data)
Sets the state of this object using information contained in the given String. |
byte |
getValue()
Returns the value wrapped by this object. |
int |
hashCode()
Returns an int hash code
appropriate for the wrapped object. |
int |
intValue()
Returns the value of this number as a int value. |
long |
longValue()
Returns the value of this number as a long value. |
static byte |
parseByte(String s)
Parses a byte value from a String |
void |
setValue(byte b)
Sets the value wrapped by this object to the provided value. |
short |
shortValue()
Returns the value of this number as a short value. |
static byte[] |
toPrimitiveArray(XByte[] x)
Returns an array of primitive byte values
copied from the given array
of XByte objects. |
String |
toString()
Returns a String representation
of the wrapped value. |
String |
toStringData()
Returns a String encapsulation of this object
that contains information needed
to set the state of this object at a later time. |
static XByte[] |
toXArray(byte[] a)
Returns an array of XByte objects
initialized from the given array
of byte values. |
| Methods inherited from class edu.neu.ccs.XObject |
addPropertyChangeListener, addPropertyChangeListener, formatErrorMessage, removePropertyChangeListener, removePropertyChangeListener, toStringArray |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private byte value
| Constructor Detail |
public XByte()
byte value.
XByte(byte),
XByte(String)public XByte(byte b)
byte value.
b - the value to be wrappedXByte(),
XByte(String)
public XByte(String s)
throws ParseException
byte value
whose state information is encapsulated
in the given String data.
s - a String representation
of the desired value
ParseException - if the data is malformedXByte(),
XByte(byte)| Method Detail |
public void fromStringData(String data)
throws ParseException
StringableString.
fromStringData in interface StringablefromStringData in class XObjectParseExceptionpublic String toStringData()
StringableString encapsulation of this object
that contains information needed
to set the state of this object at a later time.
toStringData in interface StringabletoStringData in class XObjectpublic boolean equals(Object other)
true if the wrapped object
is equal to the given object, and false
if it is not.
other - the object to be compared with the wrapped objectpublic int hashCode()
int hash code
appropriate for the wrapped object.
public String toString()
String representation
of the wrapped value.
public void setValue(byte b)
b - the value to be wrappedgetValue()public byte getValue()
setValue(byte)public byte byteValue()
XNumberbyte value.
byteValue in class XNumberpublic short shortValue()
XNumbershort value.
shortValue in class XNumberpublic int intValue()
XNumberint value.
intValue in class XNumberpublic long longValue()
XNumberlong value.
longValue in class XNumberpublic float floatValue()
XNumberfloat value.
floatValue in class XNumberpublic double doubleValue()
XNumberdouble value.
doubleValue in class XNumber
public static byte parseByte(String s)
throws NumberFormatException
byte value from a String
using the current shared parser.
- Parameters:
s - the String data to parse
- Returns:
- the extracted
byte value
- Throws:
NumberFormatException - if the data is malformed
public static byte[] toPrimitiveArray(XByte[] x)
byte values
copied from the given array
of XByte objects.
x - an array of XBytes
byte valuestoXArray(byte[])public static XByte[] toXArray(byte[] a)
XByte objects
initialized from the given array
of byte values.
a - an array of bytes
XByte objectstoPrimitiveArray(XByte[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||