1 /*
2 * Copyright 2007 - 2007 JEuclid, http://jeuclid.sf.net
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.w3c.dom.mathml;
17
18 import org.w3c.dom.DOMException;
19
20 /*
21 * Please note: This file was automatically generated from the source of the
22 * MathML specification. Do not edit it. If there are errors or missing
23 * elements, please correct the stylesheet instead.
24 */
25
26 /**
27 * The matrix element is the container element for matrixrow elements.
28 *
29 *
30 */
31 public interface MathMLMatrixElement extends MathMLContentElement {
32 /**
33 * The number of rows in the represented matrix.
34 *
35 * @return value of the nrows attribute.
36 */
37 int getNrows();
38
39 /**
40 * The number of columns in the represented matrix.
41 *
42 * @return value of the ncols attribute.
43 */
44 int getNcols();
45
46 /**
47 * The rows of the matrix, returned as a MathMLNodeList consisting of
48 * MathMLMatrixrowElements.
49 *
50 * @return value of the rows attribute.
51 */
52 MathMLNodeList getRows();
53
54 /**
55 * A convenience method to retrieve a specified row.
56 *
57 * @param index
58 * Position of the row in the list of rows. The first row is
59 * numbered 1.
60 * @return The MathMLMatrixrowElement representing the index-th row.
61 * @throws DOMException
62 * INDEX_SIZE_ERR: Raised if index is greater than the number
63 * of rows in the matrix.
64 */
65 MathMLMatrixrowElement getRow(int index) throws DOMException;
66
67 /**
68 * A convenience method to insert a row before the row that is currently
69 * the index-th row of this matrix. If index is 0, newRow is appended as
70 * the last row of the matrix.
71 *
72 * @param newRow
73 * MathMLMatrixrowElement to be inserted into the matrix.
74 * @param index
75 * Unsigned integer giving the row position before which newRow
76 * is to be inserted. The first row is numbered 1.
77 * @return The MathMLMatrixrowElement added. This is the new element
78 * within the DOM.
79 * @throws DOMException
80 * INDEX_SIZE_ERR: Raised if index is greater than one more
81 * than the number of rows in the matrix.
82 * HIERARCHY_REQUEST_ERR: Raised if the number of cells in
83 * newRow doesn't match the number of columns in the matrix.
84 */
85 MathMLMatrixrowElement insertRow(MathMLMatrixrowElement newRow, int index)
86 throws DOMException;
87
88 /**
89 * A convenience method to set the value of the index-th child matrixrow
90 * element of this element. If there is already a row at the specified
91 * index, it is replaced by newRow.
92 *
93 * @param newRow
94 * MathMLMatrixrowElement representing the matrixrow which is
95 * to become the index-th row of the matrix.
96 * @param index
97 * Unsigned integer giving the row which is to be set to
98 * newRow. The first row is numbered 1.
99 * @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 };