Class OMObject
java.lang.Object
org.episteme.core.mathematics.loaders.openmath.OMObject
- All Implemented Interfaces:
Serializable, Cloneable
- Direct Known Subclasses:
OMApplication, OMAttribution, OMBinding, OMByteArray, OMError, OMFloat, OMForeign, OMInteger, OMReference, OMRoot, OMString, OMSymbol, OMVariable
Models an abstract OpenMath object.
Note: every other OpenMath object inherits from this object. So each OpenMath object will have a hashtable of attributes.
- Version:
- $Revision: 1.2 $
- Author:
- Manfred N. Riem (mriem@manorrock.org)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionStores the attribute table. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Objectclone()This will perform a shallow copy of the object.abstract Objectcopy()Creates a copy of the OMObject.getAttribute(String name) Get an attribute.Gets the attributes.abstract StringgetType()Get the type of this element.abstract booleanisAtom()Is this an atom.abstract booleanIs this a composite object.abstract booleanIs this the same object.abstract booleanisValid()Is this a valid object.voidremoveAttribute(String name) Remove an attribute.voidsetAttribute(String name, String value) Set an attribute.voidsetAttributes(Hashtable<String, Object> newAttributes) Sets the attributes.abstract StringtoString()Returns a string representation of the object.
-
Field Details
-
attributes
-
-
Constructor Details
-
OMObject
public OMObject()Constructor.
-
-
Method Details
-
getType
-
isAtom
public abstract boolean isAtom()Is this an atom.- Returns:
- true if it is an atom, false if it is not.
-
isComposite
public abstract boolean isComposite()Is this a composite object.- Returns:
- true if it is composite, false if it is not.
-
isSame
Is this the same object.- Parameters:
object- the object to test against.- Returns:
- true if it is the same, false if it is not.
-
isValid
public abstract boolean isValid()Is this a valid object.- Returns:
- true if it is valid, false if it is not.
-
clone
-
toString
-
copy
-
getAttributes
-
setAttributes
-
getAttribute
Get an attribute.
Note: this is an extension to the OpenMath standard 1.0. For the OpenMath standard 2.0 this is needed. So if you want 1.0 compliant code do not use attributes.- Parameters:
name- the name of the attribute to get.- Returns:
- the value of the attribute.
-
setAttribute
Set an attribute.
Note: this is an extension to the OpenMath standard 1.0. For the OpenMath standard 2.0 this is needed. So if you want 1.0 compliant code do not use attributes.- Parameters:
name- the name of the attribute to set.value- the value of the attribute.
-
removeAttribute
Remove an attribute.
Note: this is an extension to the OpenMath standard 1.0. For the OpenMath standard 2.0 this is needed. So if you want 1.0 compliant code do not use attributes.- Parameters:
name- the name of the attribute to remove.
-