wt.units
Class FloatingPointWithUnits

java.lang.Object
  extended bywt.units.FloatingPointWithUnits
All Implemented Interfaces:
Comparable, Externalizable, Serializable

public class FloatingPointWithUnits
extends Object
implements Comparable, Externalizable

Attribute content wrapper for FloatingPoint with Units. Each FloatingPointWithUnits content will have wt.units.Unit object. This attribute can only be set from the constructor.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
private static String separator
           
(package private) static long serialVersionUID
           
private  Unit unit
           
 
Constructor Summary
FloatingPointWithUnits()
          Default constructor to create a Unit instance without Unit object.
FloatingPointWithUnits(Unit unit)
          Constructor to construct FloatingPointWithUnits instance with the Unit object from parameter list.
 
Method Summary
 int compareTo(Object arg0)
          

Supported API: false
 boolean equals(Object obj)
           
 int getPrecision()
          Call the getPrecision() method of Unit object.
 String getUnits()
          Call the getUnits() method from Unit object.
 double getValue()
          Call the getValue() method of the Unit object.
 int hashCode()
           
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(FloatingPointWithUnits thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 String toString()
          Returns a string representation of the object.
static FloatingPointWithUnits valueOf(String value)
          Returns a new FloatingPointWithUnits object initialized to the value of the specified String.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

unit

private Unit unit

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

separator

private static final String separator
See Also:
Constant Field Values
Constructor Detail

FloatingPointWithUnits

public FloatingPointWithUnits()
Default constructor to create a Unit instance without Unit object.

Supported API: false


FloatingPointWithUnits

public FloatingPointWithUnits(Unit unit)
Constructor to construct FloatingPointWithUnits instance with the Unit object from parameter list.

Supported API: false

Parameters:
unit -
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(FloatingPointWithUnits thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getValue

public double getValue()
Call the getValue() method of the Unit object.

Supported API: false

Returns:
double

getPrecision

public int getPrecision()
Call the getPrecision() method of Unit object.

Supported API: false

Returns:
int

getUnits

public String getUnits()
Call the getUnits() method from Unit object.

Supported API: false

Returns:
String

compareTo

public int compareTo(Object arg0)


Supported API: false

Specified by:
compareTo in interface Comparable
Parameters:
arg0 -
Returns:
int

valueOf

public static FloatingPointWithUnits valueOf(String value)
                                      throws UnitFormatException,
                                             WTNumberFormatException
Returns a new FloatingPointWithUnits object initialized to the value of the specified String.

Supported API: false

Parameters:
value - The value of the Unit object. The precision is calculated from the significant figures of this string representation.
Returns:
FloatingPointWithUnits
Throws:
UnitFormatException
WTNumberFormatException

toString

public String toString()
Returns a string representation of the object.

Supported API: false

Returns:
String

equals

public boolean equals(Object obj)

hashCode

public int hashCode()