edu.neu.ccs
Class HexXDouble

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

public class HexXDouble
extends XDouble

Class HexXDouble extends XDouble 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.XDouble
 
Fields inherited from class edu.neu.ccs.XObject
changeAdapter, VALUE
 
Constructor Summary
HexXDouble()
          Constructs a wrapper for the default double value.
HexXDouble(double x)
          Constructs a wrapper for the given double value.
HexXDouble(String s)
          Constructs a wrapper for the byte value whose state information is encapsulated in the given hexadecimal String data of length exactly 16.
 
Method Summary
 void fromStringData(String s)
          Sets the state of this object using information contained in the given hexadecimal String of length exactly 16.
 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.XDouble
byteValue, doubleValue, equals, floatValue, getValue, hashCode, intValue, isFinite, isFinite, isInfinite, isInfinite, isNaN, isNaN, longValue, parseDouble, 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

HexXDouble

public HexXDouble()
Constructs a wrapper for the default double value.

See Also:
HexXDouble(double), HexXDouble(String)

HexXDouble

public HexXDouble(double x)
Constructs a wrapper for the given double value.

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

HexXDouble

public HexXDouble(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 16.

Parameters:
s - a hexadecimal String representation of the desired value
Throws:
ParseException - if s is not hexadecimal with exactly 16 digits
See Also:
HexXDouble(), HexXDouble(double), 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 16.

Uses Hex.hexToDouble internally.

Specified by:
fromStringData in interface Stringable
Overrides:
fromStringData in class XDouble
Parameters:
s - a hexadecimal String representation of the desired value
Throws:
ParseException - if s is not hexadecimal with exactly 16 digits
See Also:
Hex.hexToDouble(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.doubleToHex internally.

Specified by:
toStringData in interface Stringable
Overrides:
toStringData in class XDouble
Returns:
a hexadecimal String encapsulation of this object
See Also:
Hex.doubleToHex(double)

toString

public String toString()

Returns the same String as toStringData.

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