Interface MathMLMatrixElement

All Superinterfaces:
Element, MathMLContentElement, MathMLElement, Node

public interface MathMLMatrixElement extends MathMLContentElement
The matrix element is the container element for matrixrow elements.
  • 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

      MathMLMatrixrowElement getRow(int index) throws DOMException
      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

      MathMLMatrixrowElement insertRow(MathMLMatrixrowElement newRow, int index) throws DOMException
      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

      MathMLMatrixrowElement setRow(MathMLMatrixrowElement newRow, int index) throws DOMException
      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

      void deleteRow(int index) throws DOMException
      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

      MathMLMatrixrowElement removeRow(int index) throws DOMException
      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.