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 Summary
Modifier and TypeMethodDescriptionvoiddeleteArgument(int index) Deletes the argument at the specified index.voiddeleteDeclaration(int index) Deletes the declaration at the specified index.getArgument(int index) Retrieves an argument at the specified index.Returns the list of all arguments (children) of this container.getDeclaration(int index) Retrieves a declaration at the specified index.Returns the list of all declarations within this container.intReturns the number of arguments (children) of this container.insertArgument(MathMLElement newArgument, int index) Inserts an argument at the specified index.insertDeclaration(MathMLDeclareElement newDeclaration, int index) Inserts a declaration at the specified index.removeArgument(int index) Removes the argument at the specified index and returns it.removeDeclaration(int index) Removes the declaration at the specified index and returns it.setArgument(MathMLElement newArgument, int index) Sets or replaces an argument at the specified index.setDeclaration(MathMLDeclareElement newDeclaration, int index) Sets or replaces a declaration at the specified index.
-
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
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
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
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
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
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
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
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
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.
-