Package org.w3c.dom.mathml
Interface MathMLMatrixElement
- All Superinterfaces:
Element,MathMLContentElement,MathMLElement,Node
The matrix element is the container element for matrixrow elements.
-
Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteRow(int index) A convenience method to delete a row.intgetNcols()The number of columns in the represented matrix.intgetNrows()The number of rows in the represented matrix.getRow(int index) A convenience method to retrieve a specified row.getRows()The rows of the matrix, returned as a MathMLNodeList consisting of MathMLMatrixrowElements.insertRow(MathMLMatrixrowElement newRow, int index) A convenience method to insert a row before the row that is currently the index-th row of this matrix.removeRow(int index) A convenience method to remove a row and return it to the caller.setRow(MathMLMatrixrowElement newRow, int index) A convenience method to set the value of the index-th child matrixrow element of this element.Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNSMethods inherited from interface org.w3c.dom.mathml.MathMLElement
getClassName, getHref, getId, getMathElementStyle, getOwnerMathElement, getXref, setClassName, setHref, setId, setMathElementStyle, setXrefMethods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Method Details
-
getNrows
int getNrows()The number of rows in the represented matrix.- Returns:
- value of the nrows attribute.
-
getNcols
int getNcols()The number of columns in the represented matrix.- Returns:
- value of the ncols attribute.
-
getRows
MathMLNodeList getRows()The rows of the matrix, returned as a MathMLNodeList consisting of MathMLMatrixrowElements.- Returns:
- value of the rows attribute.
-
getRow
A convenience method to retrieve a specified row.- Parameters:
index- Position of the row in the list of rows. The first row is numbered 1.- Returns:
- The MathMLMatrixrowElement representing the index-th row.
- Throws:
DOMException- INDEX_SIZE_ERR: Raised if index is greater than the number of rows in the matrix.
-
insertRow
A convenience method to insert a row before the row that is currently the index-th row of this matrix. If index is 0, newRow is appended as the last row of the matrix.- Parameters:
newRow- MathMLMatrixrowElement to be inserted into the matrix.index- Unsigned integer giving the row position before which newRow is to be inserted. The first row is numbered 1.- Returns:
- The MathMLMatrixrowElement added. This is the new element within the DOM.
- Throws:
DOMException- INDEX_SIZE_ERR: Raised if index is greater than one more than the number of rows in the matrix. HIERARCHY_REQUEST_ERR: Raised if the number of cells in newRow doesn't match the number of columns in the matrix.
-
setRow
A convenience method to set the value of the index-th child matrixrow element of this element. If there is already a row at the specified index, it is replaced by newRow.- Parameters:
newRow- MathMLMatrixrowElement representing the matrixrow which is to become the index-th row of the matrix.index- Unsigned integer giving the row which is to be set to newRow. The first row is numbered 1.- Returns:
- The MathMLMatrixrowElement child of this MathMLMatrixrowElement representing newRow within the DOM.
- Throws:
DOMException- INDEX_SIZE_ERR: Raised if index is greater than the number of rows in the matrix. HIERARCHY_REQUEST_ERR: Raised if the number of cells in newRow doesn't match the number of columns in the matrix.
-
deleteRow
A convenience method to delete a row. The deletion changes the indices of the following rows.- Parameters:
index- Position of the row to be deleted in the list of rows- Throws:
DOMException- INDEX_SIZE_ERR: Raised if index is greater than the number of rows in the matrix.
-
removeRow
A convenience method to remove a row and return it to the caller. The deletion changes the indices of the following rows.- Parameters:
index- Position of the row to be removed in the list of rows. The first row is numbered 1.- Returns:
- The MathMLMatrixrowElement being removed.
- Throws:
DOMException- INDEX_SIZE_ERR: Raised if index is greater than the number of rows in the matrix.
-