|
||||||||||
| 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
edu.neu.ccs.HexXByte
Class HexXByte extends XByte
by replacing the three methods:
fromStringData,
toStringData,
and toString,
to use hexadecimal digits rather than decimal digits.
| Field Summary |
| Fields inherited from class edu.neu.ccs.XByte |
|
| Fields inherited from class edu.neu.ccs.XObject |
changeAdapter, VALUE |
| Constructor Summary | |
HexXByte()
Constructs a wrapper for the default byte value. |
|
HexXByte(byte x)
Constructs a wrapper for the given byte value. |
|
HexXByte(String s)
Constructs a wrapper for the byte value whose state information is encapsulated in the given hexadecimal String data
of length at most 2. |
|
| Method Summary | |
void |
fromStringData(String s)
Sets the state of this object using information contained in the given hexadecimal String of length at most 2. |
String |
toString()
Returns "0" if the value of this object is zero; otherwise
returns the same String as toStringData with the
leading zeroes removed. |
String |
toStringData()
Returns a hexadecimal String encapsulation of this object
that contains the information needed to set the state of this object at a
later time. |
| Methods inherited from class edu.neu.ccs.XByte |
byteValue, doubleValue, equals, floatValue, getValue, hashCode, intValue, longValue, parseByte, setValue, shortValue, toPrimitiveArray, toXArray |
| 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 |
| Constructor Detail |
public HexXByte()
byte value.
HexXByte(byte),
HexXByte(String)public HexXByte(byte x)
byte value.
x - the value to be wrappedHexXByte(),
HexXByte(String)
public HexXByte(String s)
throws ParseException
String data
of length at most 2.
s - a hexadecimal String representation of the
desired value
ParseException - if s is not hexadecimal with at most 2 digitsHexXByte(),
HexXByte(byte),
fromStringData(String)| Method Detail |
public void fromStringData(String s)
throws ParseException
Sets the state of this object using information contained in the
given hexadecimal String of length at most 2.
Uses Hex.hexToByte internally.
fromStringData in interface StringablefromStringData in class XBytes - a hexadecimal String representation of the
desired value
ParseException - if s is not hexadecimal with at most 2 digitsHex.hexToByte(String)public String toStringData()
Returns a hexadecimal String encapsulation of this object
that contains the information needed to set the state of this object at a
later time.
Uses Hex.byteToHex internally.
toStringData in interface StringabletoStringData in class XByteString encapsulation of this objectHex.byteToHex(byte)public String toString()
Returns "0" if the value of this object is zero; otherwise
returns the same String as toStringData with the
leading zeroes removed.
toString in class XByteString encapsulation of this objecttoStringData()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||