Class OMError

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

public class OMError extends OMObject
Models an OpenMath error object.

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

    • symbol

      protected OMSymbol symbol
      Stores the symbol.

    • elements

      protected Vector<OMObject> elements
      Stores the errors.

  • Constructor Details

    • OMError

      public OMError(OMSymbol newSymbol)
      Constructor.

      Parameters:
      newSymbol - the error symbol
    • OMError

      public OMError()
      Constructor.

  • Method Details

    • getType

      public String getType()
      Gets the type.

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

      public void setSymbol(OMSymbol newSymbol)
      Set the symbol.

      Parameters:
      newSymbol - the error symbol to set.
    • getSymbol

      public OMSymbol getSymbol()
      Gets the symbol.

      Returns:
      the error symbol
    • getElements

      public Vector<OMObject> getElements()
      Get the elements.

      Returns:
      the elements
    • setElements

      public void setElements(Vector<OMObject> newElements)
      Set the elements.

      Parameters:
      newElements - the elements to set.
    • getElementAt

      public OMObject getElementAt(int index)
      Get element.

      Parameters:
      index - the index of the element to get.
      Returns:
      the element at the given index.
    • setElementAt

      public void setElementAt(OMObject object, int index)
      Set element.

      Parameters:
      object - the object to set.
      index - the index to set at.
    • insertElementAt

      public void insertElementAt(OMObject object, int index)
      Insert element at.

      Parameters:
      object - the object to insert.
      index - the index to insert at.
    • removeElementAt

      public void removeElementAt(int index)
      Remove element at.

      Parameters:
      index - the index to remove the object from.
    • addElement

      public void addElement(OMObject object)
      Add element.

      Parameters:
      object - the object to add.
    • removeElement

      public boolean removeElement(OMObject object)
      Remove element.

      Note: This removes the first occurence of the given element. If you want to remove all the references to the given object, continue remove until this returns false.

      Parameters:
      object - the object to remove.
      Returns:
      true if more objects exist, false otherwise.
    • removeAllElements

      public void removeAllElements()
      Remove all elements.

    • firstElement

      public OMObject firstElement()
      Get the first element.

      Returns:
      the first element.
    • lastElement

      public OMObject lastElement()
      Get the last element.

      Returns:
      the last element.
    • toString

      public String toString()
      toString.

      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 (deep copy).

      Specified by:
      copy in class OMObject
      Returns:
      the deep copy.
    • isComposite

      public boolean isComposite()
      Are we a composite object.
      Specified by:
      isComposite in class OMObject
      Returns:
      true because we are a composite object.
    • isAtom

      public boolean isAtom()
      Are we an atom object.
      Specified by:
      isAtom in class OMObject
      Returns:
      false because we are not an atom object.
    • isSame

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

      Specified by:
      isSame in class OMObject
      Parameters:
      object - the object to check against.
      Returns:
      true if it is the same object, false otherwise.
    • isValid

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

      Specified by:
      isValid in class OMObject
      Returns:
      true if valid, false otherwise.
    • replace

      public OMObject replace(OMObject source, OMObject dest)
      Replace any occurrence of source to destination.

      Parameters:
      source - the source object.
      dest - the destination object.
      Returns:
      the application with the replacing.