Class OMInteger

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

public class OMInteger extends OMObject
Models an OpenMath integer.

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

    • integer

      protected String integer
      Stores the integer.

  • Constructor Details

    • OMInteger

      public OMInteger()
      Constructor.

    • OMInteger

      public OMInteger(String newInteger)
      Constructor.

      Parameters:
      newInteger - the integer to set (as a string).
    • OMInteger

      public OMInteger(long newLong)
      Constructor.

      Parameters:
      newLong - the long to use for this OpenMath integer.
    • OMInteger

      public OMInteger(int newInteger)
      Constructor.

      Parameters:
      newInteger - the int to use for this OpenMath integer.
    • OMInteger

      public OMInteger(Long newLong)
      Constructor.

      Parameters:
      newLong - the Long to use for this OpenMath integer.
    • OMInteger

      public OMInteger(Integer newInteger)
      Constructor.

      Parameters:
      newInteger - the Integer to use for this OpenMath integer.
  • Method Details

    • getType

      public String getType()
      Gets the type.

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

      public void setInteger(String newInteger)
      Set the integer.

      Parameters:
      newInteger - the integer to set (as string).
    • setInteger

      public void setInteger(Long newLong)
      Set the integer.

      Parameters:
      newLong - the integer to set (as Long).
    • setInteger

      public void setInteger(Integer newInteger)
      Set the integer.

      Parameters:
      newInteger - the integer to set (as Integer).
    • setInteger

      public void setInteger(long newLong)
      Set the integer.

      Parameters:
      newLong - the integer to set (as Long).
    • setInteger

      public void setInteger(int newInteger)
      Set the integer.

      Parameters:
      newInteger - the integer to set (as int).
    • getInteger

      public String getInteger()
      Get the integer.

      Returns:
      the integer (as String).
    • longValue

      public long longValue()
      Return the integer as a long.

      Returns:
      the integer (as long).
    • intValue

      public int intValue()
      Returns the integer as an int.

      Returns:
      the integer (as int).
    • isAtom

      public boolean isAtom()
      Is this an atom object.

      Specified by:
      isAtom in class OMObject
      Returns:
      true because we are an atom.
    • isComposite

      public boolean isComposite()
      Is this a composite object.

      Specified by:
      isComposite in class OMObject
      Returns:
      false because we are not 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:
      the shallow copy.
    • copy

      public Object copy()
      Copies the object (full copy).
      Specified by:
      copy in class OMObject
      Returns:
      the 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 not.
    • isValid

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

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