java.lang.Object
org.apache.batik.dom.AbstractNode
org.apache.batik.dom.AbstractParentNode
org.apache.batik.dom.AbstractParentChildNode
org.apache.batik.dom.AbstractElement
org.apache.batik.dom.AbstractElementNS
org.apache.batik.dom.GenericElementNS
All Implemented Interfaces:
Serializable, JEuclidElement, JEuclidNode, LayoutableNode, org.apache.batik.dom.events.NodeEventTarget, org.apache.batik.dom.ExtendedNode, org.apache.batik.dom.xbl.NodeXBL, org.apache.batik.dom.xbl.XBLManagerData, org.apache.batik.w3c.dom.ElementTraversal, Element, EventTarget, MathMLContainer, MathMLElement, MathMLPresentationContainer, MathMLPresentationElement, MathMLSemanticsElement, Node

public final class Semantics extends AbstractContainer implements MathMLSemanticsElement
This class represents a semantics element.
Version:
$Revision: bc1d5fde7b73 $
See Also:
  • Field Details

  • Constructor Details

    • Semantics

      public Semantics(String qname, org.apache.batik.dom.AbstractDocument odoc)
      Default constructor. Sets MathML Namespace.
      Parameters:
      qname - Qualified name.
      odoc - Owner Document.
  • Method Details

    • newNode

      protected Node newNode()
      Overrides:
      newNode in class org.apache.batik.dom.GenericElementNS
    • deleteAnnotation

      public void deleteAnnotation(int index)
      A convenience method to delete the index-th alternate content associated with this semantics element.
      Specified by:
      deleteAnnotation in interface MathMLSemanticsElement
      Parameters:
      index - The one-based index of the annotation being deleted.
    • getAnnotation

      public MathMLElement getAnnotation(int index)
      This method gives access to the index-th alternate content associated with a semantics element.
      Specified by:
      getAnnotation in interface MathMLSemanticsElement
      Parameters:
      index - The one-based index of the annotation being retrieved.
      Returns:
      The MathMLAnnotationElement or MathMLXMLAnnotationElement representing the index-th annotation or annotation-xml child of the semantics element. Note that all child elements of a semantics element other than the first are required to be of one of these types.
    • getBody

      public MathMLElement getBody()
      This attribute represents the first child of the semantics element, i.e. the child giving the primary content represented by the element.
      Specified by:
      getBody in interface MathMLSemanticsElement
      Returns:
      value of the body attribute.
    • getNAnnotations

      public int getNAnnotations()
      Represents the number of annotation or annotation-xml children of the semantics element, i.e. the number of alternate content forms for this element.
      Specified by:
      getNAnnotations in interface MathMLSemanticsElement
      Returns:
      value of the nAnnotations attribute.
    • insertAnnotation

      public MathMLElement insertAnnotation(MathMLElement newAnnotation, int index)
      This method inserts newAnnotation before the current index-th alternate content associated with a semantics element. If index is 0, newAnnotation is appended as the last annotation or annotation-xml child of this element.
      Specified by:
      insertAnnotation in interface MathMLSemanticsElement
      Parameters:
      newAnnotation - A MathMLAnnotationElement or MathMLXMLAnnotationElement representing the new annotation or annotation-xml to be inserted.
      index - The position in the list of annotation or annotation-xml children before which newAnnotation is to be inserted. The first annotation is numbered 1.
      Returns:
      The MathMLAnnotationElement or MathMLXMLAnnotationElement child of this element that represents the new annotation in the DOM.
    • removeAnnotation

      public MathMLElement removeAnnotation(int index)
      A convenience method to delete the index-th alternate content associated with this semantics element, and to return it to the caller.
      Specified by:
      removeAnnotation in interface MathMLSemanticsElement
      Parameters:
      index - The one-based index of the annotation being deleted.
      Returns:
      The MathMLAnnotationElement or MathMLXMLAnnotationElement being deleted.
    • setAnnotation

      public MathMLElement setAnnotation(MathMLElement newAnnotation, int index)
      This method allows setting or replacement of the index-th alternate content associated with a semantics element. If there is already an annotation or annotation-xml element with this index, it is replaced by newAnnotation.
      Specified by:
      setAnnotation in interface MathMLSemanticsElement
      Parameters:
      newAnnotation - A MathMLAnnotationElement or MathMLXMLAnnotationElement representing the new value of the index-th annotation or annotation-xml child of this semantics element.
      index - The position in the list of annotation or annotation-xml children of this semantics element that is to be occupied by newAnnotation. The first annotation element is numbered 1.
      Returns:
      The MathMLAnnotationElement or MathMLXMLAnnotationElement child of this element that represents the new annotation in the DOM.
    • setBody

      public void setBody(MathMLElement body)
      setter for the body attribute.
      Specified by:
      setBody in interface MathMLSemanticsElement
      Parameters:
      body - new value for body.
      See Also: