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.Node;
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 the interface from which the interfaces representing the MathML
028     * Content token elements (ci, cn and csymbol) are derived. These elements may
029     * contain MathML Presentation elements, Text nodes, or a combination of both.
030     * Thus the getArgument and insertArgument methods have been provided to deal
031     * with this distinction between these elements and other MathML Content
032     * elements.
033     * 
034     * 
035     */
036    public interface MathMLContentToken extends MathMLContentElement {
037        /**
038         * The arguments of this element, returned as a MathMLNodeList. Note that
039         * this is not necessarily the same as Node::childNodes, particularly in
040         * the case of the cn element. The reason is that the sep elements that
041         * are used to separate the arguments of a cn are not returned.
042         * 
043         * @return value of the arguments attribute.
044         */
045        MathMLNodeList getArguments();
046    
047        /**
048         * A URI pointing to a semantic definition for this content element. Note
049         * that there is no stipulation about the form this definition may take!
050         * 
051         * @return value of the definitionURL attribute.
052         */
053        String getDefinitionURL();
054    
055        /**
056         * setter for the definitionURL attribute.
057         * 
058         * @param definitionURL
059         *            new value for definitionURL.
060         * @see #getDefinitionURL()
061         */
062        void setDefinitionURL(String definitionURL);
063    
064        /**
065         * A string describing the syntax in which the definition located at
066         * definitionURL is given.
067         * 
068         * @return value of the encoding attribute.
069         */
070        String getEncoding();
071    
072        /**
073         * setter for the encoding attribute.
074         * 
075         * @param encoding
076         *            new value for encoding.
077         * @see #getEncoding()
078         */
079        void setEncoding(String encoding);
080    
081        /**
082         * A convenience method to retrieve the child argument at the position
083         * referenced by index. Note that this is not necessarily the same as the
084         * index-th child Node of this Element; in particular, sep elements will
085         * not be counted.
086         * 
087         * @param index
088         *            Position of desired argument in the list of arguments. The
089         *            first argument is numbered 1.
090         * @return The Node retrieved.
091         */
092        Node getArgument(int index);
093    
094        /**
095         * A convenience method to insert newArgument before the current index-th
096         * argument child of this element. If index is 0, newArgument is appended
097         * as the last argument.
098         * 
099         * @param newArgument
100         *            Node to be inserted as the index-th argument. This will
101         *            either be a MathMLElement or a Text node.
102         * @param index
103         *            Position before which newArgument is to be inserted. The
104         *            first argument is numbered 1.Note that this is not
105         *            necessarily the index of the Node in the list of child
106         *            nodes, as nodes representing such elements as sep are not
107         *            counted as arguments.
108         * @param newArgument
109         *            Node to be inserted as the index-th argument. This will
110         *            either be a MathMLElement or a Text node.
111         * @return The Node inserted. This is the element within the DOM.
112         */
113        Node insertArgument(Node newArgument, int index);
114    
115        /**
116         * A convenience method to set an argument child at the position
117         * referenced by index. If there is currently an argument at this
118         * position, it is replaced by newArgument.
119         * 
120         * @param newArgument
121         *            Node to be inserted as the argument. This will either be a
122         *            MathMLElement or a Text node.
123         * @param index
124         *            Position of the argument that is to be set to newArgument in
125         *            the list of arguments. The first argument is numbered 1.
126         *            Note that this is not necessarily the index of the Node in
127         *            the list of child nodes, as nodes representing such elements
128         *            as sep are not counted as arguments.
129         * @param newArgument
130         *            Node to be inserted as the argument. This will either be a
131         *            MathMLElement or a Text node.
132         * @return The Node inserted. This is the element within the DOM.
133         */
134        Node setArgument(Node newArgument, int index);
135    
136        /**
137         * A convenience method to delete the argument child located at the
138         * position referenced by index.
139         * 
140         * @param index
141         *            Position of the argument to be deleted from the list of
142         *            arguments. The first argument is numbered 1.
143         */
144        void deleteArgument(int index);
145    
146        /**
147         * A convenience method to delete the argument child located at the
148         * position referenced by index, and to return it to the caller.
149         * 
150         * @param index
151         *            Position of the argument to be deleted from the list of
152         *            arguments. The first argument is numbered 1.
153         * @return A Node representing the deleted argument.
154         */
155        Node removeArgument(int index);
156    };