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     * This is an abstract interface containing functionality required by MathML
028     * elements that may contain arbitrarily many child elements. No elements are
029     * directly supported by this interface; all instances are instances of either
030     * MathMLPresentationContainer, MathMLContentContainer, or MathMLMathElement.
031     * 
032     * 
033     */
034    public interface MathMLContainer {
035        /**
036         * The number of child elements of this element which represent arguments
037         * of the element, as opposed to qualifiers or declare elements. Thus for
038         * a MathMLContentContainer it does not contain elements representing
039         * bound variables, conditions, separators, degrees, or upper or lower
040         * limits (bvar, condition, sep, degree, lowlimit, or uplimit).
041         * 
042         * @return value of the nArguments attribute.
043         */
044        int getNArguments();
045    
046        /**
047         * This attribute accesses the child MathMLElements of this element which
048         * are arguments of it, as a MathMLNodeList. Note that this list does not
049         * contain any MathMLElements representing qualifier elements or declare
050         * elements.
051         * 
052         * @return value of the arguments attribute.
053         */
054        MathMLNodeList getArguments();
055    
056        /**
057         * Provides access to the declare elements which are children of this
058         * element, in a MathMLNodeList. All Nodes in this list must be
059         * MathMLDeclareElements.
060         * 
061         * @return value of the declarations attribute.
062         */
063        MathMLNodeList getDeclarations();
064    
065        /**
066         * This method returns the indexth child argument element of this element.
067         * This frequently differs from the value of
068         * Node::childNodes().item(index), as qualifier elements and declare
069         * elements are not counted.
070         * 
071         * @param index
072         *            The one-based index of the argument to be retrieved.
073         * @return A MathMLElement representing the index-th argument of this
074         *         element.
075         * @throws DOMException
076         *             INDEX_SIZE_ERR: Raised if index is greater than the number
077         *             of child elements.
078         */
079        MathMLElement getArgument(int index) throws DOMException;
080    
081        /**
082         * This method sets newArgument as the index-th argument of this element.
083         * If there is currently an index-th argument, it is replaced by
084         * newArgument. This frequently differs from setting the node at
085         * Node::childNodes().item(index), as qualifier elements and declare
086         * elements are not counted.
087         * 
088         * @param newArgument
089         *            A MathMLElement representing the element that is to be set
090         *            as the index-th argument of this element.
091         * @param index
092         *            The index of the argument that is to be set to newArgument.
093         *            The first argument is numbered 1. If index is one more than
094         *            the current number of arguments, a new argument is appended.
095         * @return The MathMLElement child of this element that represents the new
096         *         argument in the DOM.
097         * @throws DOMException
098         *             HIERARCHY_REQUEST_ERR: Raised if this element does not
099         *             permit a child element of the type of newArgument, if this
100         *             is a MathMLContentContainer and newArgument is a qualifier
101         *             element, or if newElement is a MathMLDeclareElement.
102         *             INDEX_SIZE_ERR: Raised if index is greater than one more
103         *             than the number of child elements.
104         */
105        MathMLElement setArgument(MathMLElement newArgument, int index)
106                throws DOMException;
107    
108        /**
109         * This method inserts newArgument before the current index-th argument of
110         * this element. If index is 0, or if index is one more than the current
111         * number of arguments, newArgument is appended as the last argument. This
112         * frequently differs from setting the node at
113         * Node::childNodes().item(index), as qualifier elements and declare
114         * elements are not counted.
115         * 
116         * @param newArgument
117         *            A MathMLElement representing the element that is to be
118         *            inserted as a child argument of this element.
119         * @param index
120         *            The one-based index of the position before which newArgument
121         *            is to be inserted. The first argument is numbered 1.
122         * @return The MathMLElement child of this element that represents the new
123         *         argument in the DOM.
124         * @throws DOMException
125         *             HIERARCHY_REQUEST_ERR: Raised if this element does not
126         *             permit a child argument of the type of newArgument, or, for
127         *             MathMLContentContainers, if newArgument represents a
128         *             qualifier element. INDEX_SIZE_ERR: Raised if index is
129         *             greater than one more than the number of child arguments.
130         */
131        MathMLElement insertArgument(MathMLElement newArgument, int index)
132                throws DOMException;
133    
134        /**
135         * This method deletes the index-th child element that is an argument of
136         * this element. Note that child elements which are qualifier elements or
137         * declare elements are not counted in determining the index-th argument.
138         * 
139         * @param index
140         *            The one-based index of the argument to be deleted.
141         * @throws DOMException
142         *             INDEX_SIZE_ERR: Raised if index is greater than the number
143         *             of child elements.
144         */
145        void deleteArgument(int index) throws DOMException;
146    
147        /**
148         * This method deletes the index-th child element that is an argument of
149         * this element, and returns it to the caller. Note that child elements
150         * that are qualifier elements or declare elements are not counted in
151         * determining the index-th argument.
152         * 
153         * @param index
154         *            The one-based index of the argument to be removed.
155         * @return A MathMLElement representing the argument being removed.
156         * @throws DOMException
157         *             INDEX_SIZE_ERR: Raised if index is greater than the number
158         *             of child elements.
159         */
160        MathMLElement removeArgument(int index) throws DOMException;
161    
162        /**
163         * This method retrieves the index-th child declare element of this
164         * element.
165         * 
166         * @param index
167         *            A one-based index into the list of child declare elements of
168         *            this element giving the position of the declare element to
169         *            be retrieved.
170         * @return The MathMLDeclareElement representing the index-th child
171         *         declare.
172         * @throws DOMException
173         *             INDEX_SIZE_ERR: Raised if index is greater than the number
174         *             of child declare elements.
175         */
176        MathMLDeclareElement getDeclaration(int index) throws DOMException;
177    
178        /**
179         * This method inserts newDeclaration as the index-th child declaration of
180         * this element. If there is already an index-th declare child element, it
181         * is replaced by newDeclaration.
182         * 
183         * @param newDeclaration
184         *            A MathMLDeclareElement to be inserted as the index-th child
185         *            declare element.
186         * @param index
187         *            A one-based index into the list of child declare elements of
188         *            this element giving the position into which newDeclaration
189         *            is to be inserted. If index is one more than the number of
190         *            declare children of this element, newDeclaration is appended
191         *            as the last declare child.
192         * @return The MathMLDeclareElement being inserted.
193         * @throws DOMException
194         *             INDEX_SIZE_ERR: Raised if index is greater than one more
195         *             than the number of child declare elements.
196         *             HIERARCHY_REQUEST_ERR: Raised if this element does not
197         *             permit child declare elements.
198         */
199        MathMLDeclareElement setDeclaration(MathMLDeclareElement newDeclaration,
200                int index) throws DOMException;
201    
202        /**
203         * This method inserts newDeclaration before the current index-th child
204         * declare element of this element. If index is 0, newDeclaration is
205         * appended as the last child declare element.
206         * 
207         * @param newDeclaration
208         *            A MathMLDeclareElement to be inserted as the index-th child
209         *            declare element.
210         * @param index
211         *            A one-based index into the list of child declare elements of
212         *            this element giving the position before which newDeclaration
213         *            is to be inserted. If index is 0 or if it is one more than
214         *            the number of child declare children, newDeclaration is
215         *            appended as the last child declare element.
216         * @return The MathMLDeclareElement child of this element representing
217         *         newDeclaration in the DOM.
218         * @throws DOMException
219         *             INDEX_SIZE_ERR: Raised if index is greater than one more
220         *             than the number of child declare elements.
221         *             HIERARCHY_REQUEST_ERR: Raised if this element does not
222         *             permit child declare elements.
223         */
224        MathMLDeclareElement insertDeclaration(
225                MathMLDeclareElement newDeclaration, int index)
226                throws DOMException;
227    
228        /**
229         * This method removes the MathMLDeclareElement representing the index-th
230         * declare child element of this element, and returns it to the caller.
231         * Note that index is the position in the list of declare element
232         * children, as opposed to the position in the list of all child Nodes.
233         * 
234         * @param index
235         *            The one-based index of the declare element to be removed.
236         * @return The MathMLDeclareElement being removed as a child Node of this
237         *         element.
238         * @throws DOMException
239         *             INDEX_SIZE_ERR: Raised if index is greater than the number
240         *             of child declare elements.
241         */
242        MathMLDeclareElement removeDeclaration(int index) throws DOMException;
243    
244        /**
245         * This method deletes the MathMLDeclareElement representing the index-th
246         * declare child element of this element. Note that index is the position
247         * in the list of declare element children, as opposed to the position in
248         * the list of all child Nodes.
249         * 
250         * @param index
251         *            The one-based index of the declare element to be removed.
252         * @throws DOMException
253         *             INDEX_SIZE_ERR: Raised if index is greater than the number
254         *             of child declare elements.
255         */
256        void deleteDeclaration(int index) throws DOMException;
257    };