Interface MathMLContainer

All Known Subinterfaces:
MathMLActionElement, MathMLApplyElement, MathMLBvarElement, MathMLContentContainer, MathMLEncloseElement, MathMLFencedElement, MathMLFnElement, MathMLLambdaElement, MathMLListElement, MathMLMathElement, MathMLPaddedElement, MathMLPresentationContainer, MathMLSetElement, MathMLStyleElement, MathMLTableCellElement
All Known Implementing Classes:
MathMLActionElementImpl, MathMLApplyElementImpl, MathMLBvarElementImpl, MathMLContentContainerImpl, MathMLEncloseElementImpl, MathMLFencedElementImpl, MathMLFnElementImpl, MathMLListElementImpl, MathMLMathElementImpl, MathMLPaddedElementImpl, MathMLPresentationContainerImpl, MathMLSetElementImpl

public interface MathMLContainer
This interface is used by MathML elements that can contain other elements. It provides methods for managing arguments and declarations.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • getNArguments

      int getNArguments()
      Returns the number of arguments (children) of this container.
      Returns:
      the number of arguments.
    • getArguments

      MathMLNodeList getArguments()
      Returns the list of all arguments (children) of this container.
      Returns:
      a MathMLNodeList containing the arguments.
    • getDeclarations

      MathMLNodeList getDeclarations()
      Returns the list of all declarations within this container.
      Returns:
      a MathMLNodeList containing the declarations.
    • getArgument

      MathMLElement getArgument(int index) throws DOMException
      Retrieves an argument at the specified index.
      Parameters:
      index - the index of the argument to retrieve.
      Returns:
      the argument at the given index.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than or equal to the number of arguments.
    • setArgument

      MathMLElement setArgument(MathMLElement newArgument, int index) throws DOMException
      Sets or replaces an argument at the specified index.
      Parameters:
      newArgument - the new MathMLElement to set.
      index - the index at which to set the argument.
      Returns:
      the newly set argument.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than the number of arguments.
    • insertArgument

      MathMLElement insertArgument(MathMLElement newArgument, int index) throws DOMException
      Inserts an argument at the specified index.
      Parameters:
      newArgument - the MathMLElement to insert.
      index - the index at which to insert the argument.
      Returns:
      the newly inserted argument.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than the number of arguments.
    • deleteArgument

      void deleteArgument(int index) throws DOMException
      Deletes the argument at the specified index.
      Parameters:
      index - the index of the argument to delete.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than or equal to the number of arguments.
    • removeArgument

      MathMLElement removeArgument(int index) throws DOMException
      Removes the argument at the specified index and returns it.
      Parameters:
      index - the index of the argument to remove.
      Returns:
      the removed argument.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than or equal to the number of arguments.
    • getDeclaration

      MathMLDeclareElement getDeclaration(int index) throws DOMException
      Retrieves a declaration at the specified index.
      Parameters:
      index - the index of the declaration to retrieve.
      Returns:
      the declaration at the given index.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than or equal to the number of declarations.
    • setDeclaration

      MathMLDeclareElement setDeclaration(MathMLDeclareElement newDeclaration, int index) throws DOMException
      Sets or replaces a declaration at the specified index.
      Parameters:
      newDeclaration - the new MathMLDeclareElement to set.
      index - the index at which to set the declaration.
      Returns:
      the newly set declaration.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than the number of declarations.
    • insertDeclaration

      MathMLDeclareElement insertDeclaration(MathMLDeclareElement newDeclaration, int index) throws DOMException
      Inserts a declaration at the specified index.
      Parameters:
      newDeclaration - the MathMLDeclareElement to insert.
      index - the index at which to insert the declaration.
      Returns:
      the newly inserted declaration.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than the number of declarations.
    • removeDeclaration

      MathMLDeclareElement removeDeclaration(int index) throws DOMException
      Removes the declaration at the specified index and returns it.
      Parameters:
      index - the index of the declaration to remove.
      Returns:
      the removed declaration.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than or equal to the number of declarations.
    • deleteDeclaration

      void deleteDeclaration(int index) throws DOMException
      Deletes the declaration at the specified index.
      Parameters:
      index - the index of the declaration to delete.
      Throws:
      DOMException - INDEX_SIZE_ERR: if index is greater than or equal to the number of declarations.