Class OMFloat

java.lang.Object
org.episteme.core.mathematics.loaders.openmath.OMObject
org.episteme.core.mathematics.loaders.openmath.OMFloat
All Implemented Interfaces:
Serializable, Cloneable

public class OMFloat extends OMObject
Models an OpenMath float.

Version:
$Revision: 1.3 $
Author:
Manfred N. Riem (mriem@manorrock.org)
See Also:
  • Constructor Details

    • OMFloat

      public OMFloat()
      Constructor.

    • OMFloat

      public OMFloat(String newFloat, String newBase)
      Constructor.

      Parameters:
      newFloat - the float.
      newBase - the base.
  • Method Details

    • getType

      public String getType()
      Gets the type.

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

      public void setFloat(String newFloat)
      Sets the float.

      Parameters:
      newFloat - the float to set.
    • setFloat

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

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

      public String getFloat()
      Gets the float.

      Returns:
      the float.
    • setBase

      public void setBase(String newBase)
      Sets the base.

      Parameters:
      newBase - the base.
    • getBase

      public String getBase()
      Get the base.

      Returns:
      the base.
    • doubleValue

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

      Returns:
      the float (as double).
      Throws:
      NumberFormatException - if an error occurs
    • floatValue

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

      Returns:
      the float (as float).
      Throws:
      NumberFormatException - if an error occurs
    • 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 String toString()
      Returns a string representation of the object.

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

      public Object clone()
      Clones the object (shallow copy).
      Specified by:
      clone in class OMObject
      Returns:
      a shallow copy.
    • copy

      public 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.