View Javadoc

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   * This interface extends the MathMLPresentationElement interface for the
28   * MathML multiscripts (including prescripts or tensors) element
29   * mmultiscripts.
30   * 
31   * 
32   */
33  public interface MathMLMultiScriptsElement extends MathMLPresentationElement {
34      /**
35       * A string representing the minimum amount to shift the baseline of the
36       * subscripts down, if specified; this is the element's subscriptshift
37       * attribute.
38       * 
39       * @return value of the subscriptshift attribute.
40       */
41      String getSubscriptshift();
42  
43      /**
44       * setter for the subscriptshift attribute.
45       * 
46       * @param subscriptshift
47       *            new value for subscriptshift.
48       * @see #getSubscriptshift()
49       */
50      void setSubscriptshift(String subscriptshift);
51  
52      /**
53       * A string representing the minimum amount to shift the baseline of the
54       * superscripts up, if specified; this is the element's superscriptshift
55       * attribute.
56       * 
57       * @return value of the superscriptshift attribute.
58       */
59      String getSuperscriptshift();
60  
61      /**
62       * setter for the superscriptshift attribute.
63       * 
64       * @param superscriptshift
65       *            new value for superscriptshift.
66       * @see #getSuperscriptshift()
67       */
68      void setSuperscriptshift(String superscriptshift);
69  
70      /**
71       * A MathMLElement representing the base of the script. This is the first
72       * child of the element.
73       * 
74       * @return value of the base attribute.
75       */
76      MathMLElement getBase();
77  
78      /**
79       * setter for the base attribute.
80       * 
81       * @param base
82       *            new value for base.
83       * @see #getBase()
84       */
85      void setBase(MathMLElement base);
86  
87      /**
88       * A NodeList representing the prescripts of the script, which appear in
89       * the order described by the expression (prescript presuperscript)*. This
90       * is the same as traversing the contents of the NodeList returned by
91       * Node::childNodes() from the Node following the mprescripts (if present)
92       * to the end of the list.
93       * 
94       * @return value of the prescripts attribute.
95       */
96      MathMLNodeList getPrescripts();
97  
98      /**
99       * A MathMLNodeList representing the scripts of the script, which appear
100      * in the order described by the expression (script superscript)*. This is
101      * the same as traversing the contents of the NodeList returned by
102      * Node::childNodes() from the first Node up to and including the Node
103      * preceding the mprescripts (if present).
104      * 
105      * @return value of the scripts attribute.
106      */
107     MathMLNodeList getScripts();
108 
109     /**
110      * The number of script/subscript columns preceding (to the left of) the
111      * base. Should always be half of getprescripts().length()
112      * 
113      * @return value of the numprescriptcolumns attribute.
114      */
115     int getNumprescriptcolumns();
116 
117     /**
118      * The number of script/subscript columns following (to the right of) the
119      * base. Should always be half of getscripts().length()
120      * 
121      * @return value of the numscriptcolumns attribute.
122      */
123     int getNumscriptcolumns();
124 
125     /**
126      * A convenience method to retrieve pre-subscript children of the element,
127      * referenced by column index .
128      * 
129      * @param colIndex
130      *            Column index of prescript (where 1 represents the leftmost
131      *            prescript column).
132      * @return Returns the MathMLElement representing the colIndex-th
133      *         presubscript (to the left of the base, counting from 1 at the
134      *         far left). Note that this may be the MathMLElement
135      *         corresponding to the special element none in the case of a
136      *         missing presubscript (see the discussion of mmultiscripts), or
137      *         it may be null if colIndex is out of range for the element.
138      */
139     MathMLElement getPreSubScript(int colIndex);
140 
141     /**
142      * A convenience method to retrieve subscript children of the element,
143      * referenced by column index.
144      * 
145      * @param colIndex
146      *            Column index of script (where 1 represents the leftmost
147      *            script column, the first to the right of the base).
148      * @return Returns the MathMLElement representing the colIndex-th
149      *         subscript to the right of the base. Note that this may be the
150      *         MathMLElement corresponding to the special element none in the
151      *         case of a missing subscript (see the discussion of
152      *         mmultiscripts), or it may be null if colIndex is out of range
153      *         for the element.
154      */
155     MathMLElement getSubScript(int colIndex);
156 
157     /**
158      * A convenience method to retrieve pre-superscript children of the
159      * element, referenced by column index .
160      * 
161      * @param colIndex
162      *            Column index of pre-superscript (where 1 represents the
163      *            leftmost prescript column).
164      * @return Returns the MathMLElement representing the colIndex-th
165      *         presuperscript (to the left of the base, counting from 1 at the
166      *         far left). Note that this may be the MathMLElement
167      *         corresponding to the special element none in the case of a
168      *         missing presuperscript (see the discussion of mmultiscripts),
169      *         or it may be null if colIndex is out of range for the element.
170      */
171     MathMLElement getPreSuperScript(int colIndex);
172 
173     /**
174      * A convenience method to retrieve superscript children of the element,
175      * referenced by column index .
176      * 
177      * @param colIndex
178      *            Column index of script (where 1 represents the leftmost
179      *            script column, the first to the right of the base)
180      * @return Returns the MathMLElement representing the colIndex-th
181      *         superscript to the right of the base. Note that this may be the
182      *         MathMLElement corresponding to the special element none in the
183      *         case of a missing superscript (see the discussion of
184      *         mmultiscripts), or it may be null if colIndex is out of range
185      *         for the element.
186      */
187     MathMLElement getSuperScript(int colIndex);
188 
189     /**
190      * A convenience method to insert a pre-subscript before the position
191      * referenced by column index. If colIndex is 0, the new pre-subscript is
192      * appended as the last pre-subscript of the mmultiscripts element; if
193      * colIndex is 1, a new pre-subscript is prepended at the far left. Note
194      * that inserting a new pre-subscript will cause the insertion of an empty
195      * pre-superscript in the same column.
196      * 
197      * @param colIndex
198      *            Column index of pre-subscript (where 1 represents the
199      *            leftmost prescript column).
200      * @param newScript
201      *            A MathMLElement representing the element to be inserted as a
202      *            pre-subscript.
203      * @return The MathMLElement child of this MathMLMultiScriptsElement
204      *         representing the new script in the DOM.
205      * @throws DOMException
206      *             HIERARCHY_REQUEST_ERR: Raised if newScript represents an
207      *             element that cannot be a pre-subscript. INDEX_SIZE_ERR:
208      *             Raised if colIndex is greater than the number of
209      *             pre-scripts of the element.
210      */
211     MathMLElement insertPreSubScriptBefore(int colIndex,
212             MathMLElement newScript) throws DOMException;
213 
214     /**
215      * A convenience method to set the pre-subscript child at the position
216      * referenced by colIndex. If there is currently a pre-subscript at this
217      * position, it is replaced by newScript.
218      * 
219      * @param colIndex
220      *            Column index of pre-subscript (where 1 represents the
221      *            leftmost prescript column).
222      * @param newScript
223      *            MathMLElement representing the element that is to be set as
224      *            the colIndex-th pre-subscript child of this element.
225      * @return The MathMLElement child of this MathMLMultiScriptsElement
226      *         representing the new pre-subscript in the DOM.
227      * @throws DOMException
228      *             HIERARCHY_REQUEST_ERR: Raised if newScript represents an
229      *             element that cannot be a pre-subscript. INDEX_SIZE_ERR:
230      *             Raised if colIndex is greater than one more than the number
231      *             of pre-scripts of the element.
232      */
233     MathMLElement setPreSubScriptAt(int colIndex, MathMLElement newScript)
234             throws DOMException;
235 
236     /**
237      * A convenience method to insert a subscript before the position
238      * referenced by column index. If colIndex is 0, the new subscript is
239      * appended as the last subscript of the mmultiscripts element; if
240      * colIndex is 1, a new subscript is prepended at the far left. Note that
241      * inserting a new subscript will cause the insertion of an empty
242      * superscript in the same column.
243      * 
244      * @param colIndex
245      *            Column index of subscript, where 1 represents the leftmost
246      *            script column (the first to the right of the base).
247      * @param newScript
248      *            A MathMLElement representing the element to be inserted as a
249      *            subscript.
250      * @return The MathMLElement child of this MathMLMultiScriptsElement that
251      *         represents the new subscript in the DOM.
252      * @throws DOMException
253      *             HIERARCHY_REQUEST_ERR: Raised if newScript represents an
254      *             element that cannot be a subscript. INDEX_SIZE_ERR: Raised
255      *             if colIndex is greater than the number of scripts of the
256      *             element.
257      */
258     MathMLElement insertSubScriptBefore(int colIndex, MathMLElement newScript)
259             throws DOMException;
260 
261     /**
262      * A convenience method to set the subscript child at the position
263      * referenced by colIndex. If there is currently a subscript at this
264      * position, it is replaced by newScript.
265      * 
266      * @param colIndex
267      *            Column index of subscript, where 1 represents the leftmost
268      *            script column (the first to the right of the base).
269      * @param newScript
270      *            MathMLElement representing the element that is to be set as
271      *            the colIndex-th subscript child of this element.
272      * @return The MathMLElement child of this element representing the new
273      *         subscript in the DOM.
274      * @throws DOMException
275      *             HIERARCHY_REQUEST_ERR: Raised if newScript represents an
276      *             element that cannot be a subscript. INDEX_SIZE_ERR: Raised
277      *             if colIndex is greater than one more than the number of
278      *             scripts of the element.
279      */
280     MathMLElement setSubScriptAt(int colIndex, MathMLElement newScript)
281             throws DOMException;
282 
283     /**
284      * A convenience method to insert a pre-superscript before the position
285      * referenced by column index. If colIndex is 0, the new pre-superscript
286      * is appended as the last pre-superscript of the mmultiscripts element;
287      * if colIndex is 1, a new pre-superscript is prepended at the far left.
288      * Note that inserting a new pre-superscript will cause the insertion of
289      * an empty pre-subscript in the same column.
290      * 
291      * @param colIndex
292      *            Column index of pre-superscript (where 1 represents the
293      *            leftmost prescript column).
294      * @param newScript
295      *            A MathMLElement representing the element to be inserted as a
296      *            pre-superscript.
297      * @return The MathMLElement child of this element that represents the new
298      *         pre-superscript in the DOM.
299      * @throws DOMException
300      *             HIERARCHY_REQUEST_ERR: Raised if newScript represents an
301      *             element that cannot be a pre-superscript. INDEX_SIZE_ERR:
302      *             Raised if colIndex is greater than the number of
303      *             pre-scripts of the element.
304      */
305     MathMLElement insertPreSuperScriptBefore(int colIndex,
306             MathMLElement newScript) throws DOMException;
307 
308     /**
309      * A convenience method to set the pre-superscript child at the position
310      * referenced by colIndex. If there is currently a pre-superscript at this
311      * position, it is replaced by newScript.
312      * 
313      * @param colIndex
314      *            Column index of pre-superscript (where 1 represents the
315      *            leftmost prescript column).
316      * @param newScript
317      *            MathMLElement representing the element that is to be set as
318      *            the colIndex-th pre-superscript child of this element.
319      * @return The MathMLElement child of this element that represents the new
320      *         pre-superscript in the DOM.
321      * @throws DOMException
322      *             HIERARCHY_REQUEST_ERR: Raised if newScript represents an
323      *             element that cannot be a pre-superscript. INDEX_SIZE_ERR:
324      *             Raised if colIndex is greater than one more than the number
325      *             of pre-scripts of the element.
326      */
327     MathMLElement setPreSuperScriptAt(int colIndex, MathMLElement newScript)
328             throws DOMException;
329 
330     /**
331      * A convenience method to insert a superscript before the position
332      * referenced by column index. If colIndex is 0, the new superscript is
333      * appended as the last superscript of the mmultiscripts element; if
334      * colIndex is 1, a new superscript is prepended at the far left. Note
335      * that inserting a new superscript will cause the insertion of an empty
336      * subscript in the same column.
337      * 
338      * @param colIndex
339      *            Column index of superscript, where 1 represents the leftmost
340      *            script column (the first to the right of the base).
341      * @param newScript
342      *            A MathMLElement representing the element to be inserted as a
343      *            superscript.
344      * @return The MathMLElement child of this element that represents the new
345      *         superscript in the DOM.
346      * @throws DOMException
347      *             HIERARCHY_REQUEST_ERR: Raised if newScript represents an
348      *             element that cannot be a superscript. INDEX_SIZE_ERR:
349      *             Raised if colIndex is greater than the number of scripts of
350      *             the element.
351      */
352     MathMLElement insertSuperScriptBefore(int colIndex,
353             MathMLElement newScript) throws DOMException;
354 
355     /**
356      * A convenience method to set the superscript child at the position
357      * referenced by colIndex. If there is currently a superscript at this
358      * position, it is replaced by newScript.
359      * 
360      * @param colIndex
361      *            Column index of superscript, where 1 represents the leftmost
362      *            script column (the first to the right of the base).
363      * @param newScript
364      *            MathMLElement representing the element that is to be set as
365      *            the colIndex-th superscript child of this element.
366      * @return The MathMLElement child of this element that represents the new
367      *         superscript in the DOM.
368      * @throws DOMException
369      *             HIERARCHY_REQUEST_ERR: Raised if newScript represents an
370      *             element that cannot be a superscript. INDEX_SIZE_ERR:
371      *             Raised if colIndex is greater than one more than the number
372      *             of scripts of the element.
373      */
374     MathMLElement setSuperScriptAt(int colIndex, MathMLElement newScript)
375             throws DOMException;
376 };