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   * vector is the container element for a vector.
28   * 
29   * 
30   */
31  public interface MathMLVectorElement extends MathMLContentElement {
32      /**
33       * The number of components in the vector.
34       * 
35       * @return value of the ncomponents attribute.
36       */
37      int getNcomponents();
38  
39      /**
40       * A convenience method to retrieve a component.
41       * 
42       * @param index
43       *            Position of the component in the list of components. The
44       *            first element is numbered 1.
45       * @return The MathMLContentElement component at the position specified by
46       *         index. If index is not a valid index (i.e. is greater than the
47       *         number of components of the vector or less than 1), a null
48       *         MathMLContentElement is returned.
49       */
50      MathMLContentElement getComponent(int index);
51  
52      /**
53       * A convenience method to insert a new component in the vector before the
54       * current index-th component. If index is 0 or is one more than the
55       * number of components currently in the vector, newComponent is appended
56       * as the last component of the vector.
57       * 
58       * @param newComponent
59       *            A MathMLContentElement representing the component that is to
60       *            be added.
61       * @param index
62       *            Position of the component in the list of components. The
63       *            first component is numbered 1.
64       * @return The MathMLContentElement child of this MathMLVectorElement
65       *         representing the new component in the DOM.
66       * @throws DOMException
67       *             INDEX_SIZE_ERR: Raised if index is greater than one more
68       *             than the current number of components of this vector
69       *             element.
70       */
71      MathMLContentElement insertComponent(MathMLContentElement newComponent,
72              int index) throws DOMException;
73  
74      /**
75       * A convenience method to set the index-th component of the vector to
76       * newComponent. If index is one more than the current number of
77       * components, newComponent is appended as the last component.
78       * 
79       * @param newComponent
80       *            A MathMLContentElement representing the element that is to
81       *            be the index-th component of the vector.
82       * @param index
83       *            Position of the component in the list of components. The
84       *            first element is numbered 1.
85       * @return The MathMLContentElement child of this MathMLVectorElement that
86       *         represents the new component in the DOM.
87       * @throws DOMException
88       *             INDEX_SIZE_ERR: Raised if index is greater than one more
89       *             than the current number of components of this vector
90       *             element.
91       */
92      MathMLContentElement setComponent(MathMLContentElement newComponent,
93              int index) throws DOMException;
94  
95      /**
96       * A convenience method to delete an element. The deletion changes the
97       * indices of the following components.
98       * 
99       * @param index
100      *            Position of the component in the vector. The position of the
101      *            first component is 1
102      * @return None
103      * @throws DOMException
104      *             INDEX_SIZE_ERR: Raised if index is greater than the current
105      *             number of components of this vector element.
106      */
107     void deleteComponent(int index) throws DOMException;
108 
109     /**
110      * A convenience method to remove a component from a vector and return it
111      * to the caller. If index is greater than the number of components or is
112      * 0, a null MathMLContentElement is returned.
113      * 
114      * @param index
115      *            Position of the component in the list of components. The
116      *            first element is numbered 1.
117      * @return The MathMLContentElement component being removed.
118      */
119     MathMLContentElement removeComponent(int index);
120 };