org.jscience.ml.openmath
Class OMFloat

java.lang.Object
  extended by org.jscience.ml.openmath.OMObject
      extended by org.jscience.ml.openmath.OMFloat
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class OMFloat
extends OMObject

Models an OpenMath float.

See Also:
"The OpenMath standard 2.0, 2.1.1", Serialized Form

Field Summary
 
Fields inherited from class org.jscience.ml.openmath.OMObject
attributes
 
Constructor Summary
OMFloat()
          Constructor.
OMFloat(java.lang.String newFloat, java.lang.String newBase)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Clones the object (shallow copy).
 java.lang.Object copy()
          Copies the object (full copy).
 double doubleValue()
          Returns the float as a double.
 float floatValue()
          Returns the float as a float.
 java.lang.String getBase()
          Get the base.
 java.lang.String getFloat()
          Gets the float.
 java.lang.String getType()
          Gets the type.
 boolean isAtom()
          Is this an atom object.
 boolean isComposite()
          Is this a composite object.
 boolean isSame(OMObject object)
          Determines if this is the same object.
 boolean isValid()
          Determines if this is a valid object.
 void setBase(java.lang.String newBase)
          Sets the base.
 void setFloat(java.lang.String newFloat)
          Sets the float.
 void setFloat(java.lang.String newFloat, java.lang.String newBase)
          Sets the float.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.jscience.ml.openmath.OMObject
getAttribute, getAttributes, removeAttribute, setAttribute, setAttributes
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OMFloat

public OMFloat()
Constructor.


OMFloat

public OMFloat(java.lang.String newFloat,
               java.lang.String newBase)
Constructor.

Parameters:
newFloat - the float.
newBase - the base.
Method Detail

getType

public java.lang.String getType()
Gets the type.

Specified by:
getType in class OMObject
Returns:
the type.

setFloat

public void setFloat(java.lang.String newFloat)
Sets the float.

Parameters:
newFloat - the float to set.

setFloat

public void setFloat(java.lang.String newFloat,
                     java.lang.String newBase)
Sets the float.

Parameters:
newFloat - the float.
newBase - the base.

getFloat

public java.lang.String getFloat()
Gets the float.

Returns:
the float.

setBase

public void setBase(java.lang.String newBase)
Sets the base.

Parameters:
newBase - the base.

getBase

public java.lang.String getBase()
Get the base.

Returns:
the base.

doubleValue

public double doubleValue()
Returns the float as a double.

Returns:
the float (as double).
Throws:
java.lang.NumberFormatException - DOCUMENT ME!

floatValue

public float floatValue()
Returns the float as a float.

Returns:
the float (as float).
Throws:
java.lang.NumberFormatException - DOCUMENT ME!

isAtom

public boolean isAtom()
Is this an atom object.

Specified by:
isAtom in class OMObject
Returns:
true because this is an atom.

isComposite

public boolean isComposite()
Is this a composite object.

Specified by:
isComposite in class OMObject
Returns:
false because this is not a composite.

toString

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

Specified by:
toString in class OMObject
Returns:
the string representation.

clone

public java.lang.Object clone()
Clones the object (shallow copy).

Specified by:
clone in class OMObject
Returns:
a shallow copy.

copy

public java.lang.Object copy()
Copies the object (full copy).

Specified by:
copy in class OMObject
Returns:
a deep copy.

isSame

public boolean isSame(OMObject object)
Determines if this is the same object.

Specified by:
isSame in class OMObject
Parameters:
object - the object to test against.
Returns:
true if it is the same, false if it is not.

isValid

public boolean isValid()
Determines if this is a valid object.

Specified by:
isValid in class OMObject
Returns:
true if it is valid, false if it is not.