001 /* 002 * Copyright 2007 - 2007 JEuclid, http://jeuclid.sf.net 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.w3c.dom.mathml; 017 018 import org.w3c.dom.DOMException; 019 020 /* 021 * Please note: This file was automatically generated from the source of the 022 * MathML specification. Do not edit it. If there are errors or missing 023 * elements, please correct the stylesheet instead. 024 */ 025 026 /** 027 * The matrix element is the container element for matrixrow elements. 028 * 029 * 030 */ 031 public interface MathMLMatrixElement extends MathMLContentElement { 032 /** 033 * The number of rows in the represented matrix. 034 * 035 * @return value of the nrows attribute. 036 */ 037 int getNrows(); 038 039 /** 040 * The number of columns in the represented matrix. 041 * 042 * @return value of the ncols attribute. 043 */ 044 int getNcols(); 045 046 /** 047 * The rows of the matrix, returned as a MathMLNodeList consisting of 048 * MathMLMatrixrowElements. 049 * 050 * @return value of the rows attribute. 051 */ 052 MathMLNodeList getRows(); 053 054 /** 055 * A convenience method to retrieve a specified row. 056 * 057 * @param index 058 * Position of the row in the list of rows. The first row is 059 * numbered 1. 060 * @return The MathMLMatrixrowElement representing the index-th row. 061 * @throws DOMException 062 * INDEX_SIZE_ERR: Raised if index is greater than the number 063 * of rows in the matrix. 064 */ 065 MathMLMatrixrowElement getRow(int index) throws DOMException; 066 067 /** 068 * A convenience method to insert a row before the row that is currently 069 * the index-th row of this matrix. If index is 0, newRow is appended as 070 * the last row of the matrix. 071 * 072 * @param newRow 073 * MathMLMatrixrowElement to be inserted into the matrix. 074 * @param index 075 * Unsigned integer giving the row position before which newRow 076 * is to be inserted. The first row is numbered 1. 077 * @return The MathMLMatrixrowElement added. This is the new element 078 * within the DOM. 079 * @throws DOMException 080 * INDEX_SIZE_ERR: Raised if index is greater than one more 081 * than the number of rows in the matrix. 082 * HIERARCHY_REQUEST_ERR: Raised if the number of cells in 083 * newRow doesn't match the number of columns in the matrix. 084 */ 085 MathMLMatrixrowElement insertRow(MathMLMatrixrowElement newRow, int index) 086 throws DOMException; 087 088 /** 089 * A convenience method to set the value of the index-th child matrixrow 090 * element of this element. If there is already a row at the specified 091 * index, it is replaced by newRow. 092 * 093 * @param newRow 094 * MathMLMatrixrowElement representing the matrixrow which is 095 * to become the index-th row of the matrix. 096 * @param index 097 * Unsigned integer giving the row which is to be set to 098 * newRow. The first row is numbered 1. 099 * @return The MathMLMatrixrowElement child of this MathMLMatrixrowElement 100 * representing newRow within the DOM. 101 * @throws DOMException 102 * INDEX_SIZE_ERR: Raised if index is greater than the number 103 * of rows in the matrix. HIERARCHY_REQUEST_ERR: Raised if the 104 * number of cells in newRow doesn't match the number of 105 * columns in the matrix. 106 */ 107 MathMLMatrixrowElement setRow(MathMLMatrixrowElement newRow, int index) 108 throws DOMException; 109 110 /** 111 * A convenience method to delete a row. The deletion changes the indices 112 * of the following rows. 113 * 114 * @param index 115 * Position of the row to be deleted in the list of rows 116 * @return None 117 * @throws DOMException 118 * INDEX_SIZE_ERR: Raised if index is greater than the number 119 * of rows in the matrix. 120 */ 121 void deleteRow(int index) throws DOMException; 122 123 /** 124 * A convenience method to remove a row and return it to the caller. The 125 * deletion changes the indices of the following rows. 126 * 127 * @param index 128 * Position of the row to be removed in the list of rows. The 129 * first row is numbered 1. 130 * @return The MathMLMatrixrowElement being removed. 131 * @throws DOMException 132 * INDEX_SIZE_ERR: Raised if index is greater than the number 133 * of rows in the matrix. 134 */ 135 MathMLMatrixrowElement removeRow(int index) throws DOMException; 136 };