Interface MathMLContentToken

All Superinterfaces:
Element, MathMLContentElement, MathMLElement, Node
All Known Subinterfaces:
MathMLCiElement, MathMLCnElement, MathMLCsymbolElement

public interface MathMLContentToken extends MathMLContentElement
This is the interface from which the interfaces representing the MathML Content token elements (ci, cn and csymbol) are derived. These elements may contain MathML Presentation elements, Text nodes, or a combination of both. Thus the getArgument and insertArgument methods have been provided to deal with this distinction between these elements and other MathML Content elements.
  • Method Details

    • getArguments

      MathMLNodeList getArguments()
      The arguments of this element, returned as a MathMLNodeList. Note that this is not necessarily the same as Node::childNodes, particularly in the case of the cn element. The reason is that the sep elements that are used to separate the arguments of a cn are not returned.
      Returns:
      value of the arguments attribute.
    • getDefinitionURL

      String getDefinitionURL()
      A URI pointing to a semantic definition for this content element. Note that there is no stipulation about the form this definition may take!
      Returns:
      value of the definitionURL attribute.
    • setDefinitionURL

      void setDefinitionURL(String definitionURL)
      setter for the definitionURL attribute.
      Parameters:
      definitionURL - new value for definitionURL.
      See Also:
    • getEncoding

      String getEncoding()
      A string describing the syntax in which the definition located at definitionURL is given.
      Returns:
      value of the encoding attribute.
    • setEncoding

      void setEncoding(String encoding)
      setter for the encoding attribute.
      Parameters:
      encoding - new value for encoding.
      See Also:
    • getArgument

      Node getArgument(int index)
      A convenience method to retrieve the child argument at the position referenced by index. Note that this is not necessarily the same as the index-th child Node of this Element; in particular, sep elements will not be counted.
      Parameters:
      index - Position of desired argument in the list of arguments. The first argument is numbered 1.
      Returns:
      The Node retrieved.
    • insertArgument

      Node insertArgument(Node newArgument, int index)
      A convenience method to insert newArgument before the current index-th argument child of this element. If index is 0, newArgument is appended as the last argument.
      Parameters:
      newArgument - Node to be inserted as the index-th argument. This will either be a MathMLElement or a Text node.
      index - Position before which newArgument is to be inserted. The first argument is numbered 1.Note that this is not necessarily the index of the Node in the list of child nodes, as nodes representing such elements as sep are not counted as arguments.
      newArgument - Node to be inserted as the index-th argument. This will either be a MathMLElement or a Text node.
      Returns:
      The Node inserted. This is the element within the DOM.
    • setArgument

      Node setArgument(Node newArgument, int index)
      A convenience method to set an argument child at the position referenced by index. If there is currently an argument at this position, it is replaced by newArgument.
      Parameters:
      newArgument - Node to be inserted as the argument. This will either be a MathMLElement or a Text node.
      index - Position of the argument that is to be set to newArgument in the list of arguments. The first argument is numbered 1. Note that this is not necessarily the index of the Node in the list of child nodes, as nodes representing such elements as sep are not counted as arguments.
      newArgument - Node to be inserted as the argument. This will either be a MathMLElement or a Text node.
      Returns:
      The Node inserted. This is the element within the DOM.
    • deleteArgument

      void deleteArgument(int index)
      A convenience method to delete the argument child located at the position referenced by index.
      Parameters:
      index - Position of the argument to be deleted from the list of arguments. The first argument is numbered 1.
    • removeArgument

      Node removeArgument(int index)
      A convenience method to delete the argument child located at the position referenced by index, and to return it to the caller.
      Parameters:
      index - Position of the argument to be deleted from the list of arguments. The first argument is numbered 1.
      Returns:
      A Node representing the deleted argument.