Interface MathMLVectorElement

All Superinterfaces:
Element, MathMLContentElement, MathMLElement, Node

public interface MathMLVectorElement extends MathMLContentElement
vector is the container element for a vector.
  • Method Details

    • getNcomponents

      int getNcomponents()
      The number of components in the vector.
      Returns:
      value of the ncomponents attribute.
    • getComponent

      MathMLContentElement getComponent(int index)
      A convenience method to retrieve a component.
      Parameters:
      index - Position of the component in the list of components. The first element is numbered 1.
      Returns:
      The MathMLContentElement component at the position specified by index. If index is not a valid index (i.e. is greater than the number of components of the vector or less than 1), a null MathMLContentElement is returned.
    • insertComponent

      MathMLContentElement insertComponent(MathMLContentElement newComponent, int index) throws DOMException
      A convenience method to insert a new component in the vector before the current index-th component. If index is 0 or is one more than the number of components currently in the vector, newComponent is appended as the last component of the vector.
      Parameters:
      newComponent - A MathMLContentElement representing the component that is to be added.
      index - Position of the component in the list of components. The first component is numbered 1.
      Returns:
      The MathMLContentElement child of this MathMLVectorElement representing the new component in the DOM.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than one more than the current number of components of this vector element.
    • setComponent

      MathMLContentElement setComponent(MathMLContentElement newComponent, int index) throws DOMException
      A convenience method to set the index-th component of the vector to newComponent. If index is one more than the current number of components, newComponent is appended as the last component.
      Parameters:
      newComponent - A MathMLContentElement representing the element that is to be the index-th component of the vector.
      index - Position of the component in the list of components. The first element is numbered 1.
      Returns:
      The MathMLContentElement child of this MathMLVectorElement that represents the new component in the DOM.
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than one more than the current number of components of this vector element.
    • deleteComponent

      void deleteComponent(int index) throws DOMException
      A convenience method to delete an element. The deletion changes the indices of the following components.
      Parameters:
      index - Position of the component in the vector. The position of the first component is 1
      Throws:
      DOMException - INDEX_SIZE_ERR: Raised if index is greater than the current number of components of this vector element.
    • removeComponent

      MathMLContentElement removeComponent(int index)
      A convenience method to remove a component from a vector and return it to the caller. If index is greater than the number of components or is 0, a null MathMLContentElement is returned.
      Parameters:
      index - Position of the component in the list of components. The first element is numbered 1.
      Returns:
      The MathMLContentElement component being removed.