edu.neu.ccs
Class HexXFloat

java.lang.Object
  extended byedu.neu.ccs.XObject
      extended byedu.neu.ccs.XNumber
          extended byedu.neu.ccs.XFloat
              extended byedu.neu.ccs.HexXFloat
All Implemented Interfaces:
Cloneable, Serializable, Stringable

public class HexXFloat
extends XFloat

Class HexXFloat extends XFloat by replacing the three methods: fromStringData, toStringData, and toString, to use hexadecimal digits rather than decimal digits.

Since:
2.3
Version:
2.3
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.neu.ccs.XFloat
 
Fields inherited from class edu.neu.ccs.XObject
changeAdapter, VALUE
 
Constructor Summary
HexXFloat()
          Constructs a wrapper for the default float value.
HexXFloat(float x)
          Constructs a wrapper for the given float value.
HexXFloat(String s)
          Constructs a wrapper for the byte value whose state information is encapsulated in the given hexadecimal String data of length exactly 8.
 
Method Summary
 void fromStringData(String s)
          Sets the state of this object using information contained in the given hexadecimal String of length exactly 8.
 String toString()
          Returns the same String as toStringData.
 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.XFloat
byteValue, doubleValue, equals, floatValue, getValue, hashCode, intValue, longValue, parseFloat, 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

HexXFloat

public HexXFloat()
Constructs a wrapper for the default float value.

See Also:
HexXFloat(float), HexXFloat(String)

HexXFloat

public HexXFloat(float x)
Constructs a wrapper for the given float value.

Parameters:
x - the value to be wrapped
See Also:
HexXFloat(), HexXFloat(String)

HexXFloat

public HexXFloat(String s)
          throws ParseException
Constructs a wrapper for the byte value whose state information is encapsulated in the given hexadecimal String data of length exactly 8.

Parameters:
s - a hexadecimal String representation of the desired value
Throws:
ParseException - if s is not hexadecimal with exactly 8 digits
See Also:
HexXFloat(), HexXFloat(float), fromStringData(String)
Method Detail

fromStringData

public void fromStringData(String s)
                    throws ParseException

Sets the state of this object using information contained in the given hexadecimal String of length exactly 8.

Uses Hex.hexToFloat internally.

Specified by:
fromStringData in interface Stringable
Overrides:
fromStringData in class XFloat
Parameters:
s - a hexadecimal String representation of the desired value
Throws:
ParseException - if s is not hexadecimal with exactly 8 digits
See Also:
Hex.hexToFloat(String)

toStringData

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.floatToHex internally.

Specified by:
toStringData in interface Stringable
Overrides:
toStringData in class XFloat
Returns:
a hexadecimal String encapsulation of this object
See Also:
Hex.floatToHex(float)

toString

public String toString()

Returns the same String as toStringData.

Overrides:
toString in class XFloat
Returns:
a hexadecimal String encapsulation of this object
See Also:
toStringData()