Version: 1.1.1

org.biomoby.shared.datatypes
Class MobyFloat

java.lang.Object
  extended by org.biomoby.shared.datatypes.MobyObject
      extended by org.biomoby.shared.datatypes.MobyFloat

public class MobyFloat
extends MobyObject

An object representing a Float, a Moby primitive data type.

The value of this object is stored internally as a string, but during setting it (setValue(java.lang.String)) it checks for its numeric value.

Version:
$Id: MobyFloat.java,v 1.1 2005/08/26 06:27:05 senger Exp $
Author:
Martin Senger

Constructor Summary
MobyFloat()
          Default constructor.
MobyFloat(double value)
          Another constructor.
 
Method Summary
 double getFloatValue()
          Return the value of this object as a numeric object (double).
 void setValue(String value)
          Additionally to the same method in the superclass, it checks for numerical value (its length is not limited - internaly it uses BigDecimal object).
 org.jdom.Element toXML()
          Create an XML element representing this object.
 
Methods inherited from class org.biomoby.shared.datatypes.MobyObject
addXref, format, getId, getMobyTypeName, getName, getNamespace, getProvision, getValue, getXrefs, isPrimitiveType, setId, setName, setNamespace, setProvision, setValueXML, setXrefs, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MobyFloat

public MobyFloat()
Default constructor.


MobyFloat

public MobyFloat(double value)
Another constructor.

Parameters:
value - will become the value of this object. If a bigger number is to be stored then use setValue(String).
Method Detail

toXML

public org.jdom.Element toXML()
Description copied from class: MobyObject
Create an XML element representing this object.

Overrides:
toXML in class MobyObject
Returns:
a jDom element that can be easily incorporated into a bigger XML document

setValue

public void setValue(String value)
              throws MobyException
Additionally to the same method in the superclass, it checks for numerical value (its length is not limited - internaly it uses BigDecimal object).

Overrides:
setValue in class MobyObject
Parameters:
value - to be stored
Throws:
MobyException - if the 'value' is not numeric (which includes the case when it is an empty string)
See Also:
how to set value as CDATA

getFloatValue

public double getFloatValue()
                     throws MobyException
Return the value of this object as a numeric object (double).

Throws:
MobyException - if the value is too big to be stored in as Java's double.
See Also:
MobyObject.getValue()

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010