KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > dom3 > as > ASNamedObjectMap


1 /*
2  * Copyright (c) 2001 World Wide Web Consortium,
3  * (Massachusetts Institute of Technology, Institut National de
4  * Recherche en Informatique et en Automatique, Keio University). All
5  * Rights Reserved. This program is distributed under the W3C's Software
6  * Intellectual Property License. This program is distributed in the
7  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  * PURPOSE.
10  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11  */

12
13 package org.apache.xerces.dom3.as;
14
15 import org.w3c.dom.DOMException JavaDoc;
16
17 /**
18  * @deprecated
19  * Objects implementing the <code>ASNamedObjectMap</code> interface are used
20  * to represent collections of abstract schema nodes that can be accessed by
21  * name. Note that <code>ASNamedObjectMap</code> does not inherit from
22  * <code>ASObjectList</code>; <code>ASNamedObjectMaps</code> are not
23  * maintained in any particular order. Objects contained in an object
24  * implementing <code>ASNamedObjectMap</code> may also be accessed by an
25  * ordinal index, but this is simply to allow convenient enumeration of the
26  * contents of a <code>ASNamedObjectMap</code>, and does not imply that the
27  * DOM specifies an order to these <code>ASObjects</code>.
28  * <p><code>ASNamedObjectMap</code> object in the DOM are live.
29  * <p>See also the <a HREF='http://www.w3.org/TR/2001/WD-DOM-Level-3-ASLS-20011025'>Document Object Model (DOM) Level 3 Abstract Schemas and Load
30 and Save Specification</a>.
31  */

32 public interface ASNamedObjectMap {
33     /**
34      * The number of <code>ASObjects</code> in the <code>ASObjectList</code>.
35      * The range of valid child node indices is 0 to <code>length-1</code>
36      * inclusive.
37      */

38     public int getLength();
39
40     /**
41      * Retrieves an <code>ASObject</code> specified by name.
42      * @param name The <code>nodeName</code> of an <code>ASObject</code> to
43      * retrieve.
44      * @return An <code>ASObject</code> with specified node name and
45      * <code>null</code> if the map does not contain an element with the
46      * given name.
47      */

48     public ASObject getNamedItem(String JavaDoc name);
49
50     /**
51      * Retrieves an <code>ASObject</code> specified by local name and
52      * namespace URI.
53      * @param namespaceURI The namespace URI of the <code>ASObject</code> to
54      * retrieve.
55      * @param localName The local name of the <code>ASObject</code> to
56      * retrieve.
57      * @return A <code>ASObject</code> (of any type) with the specified local
58      * name and namespace URI, or <code>null</code> if they do not
59      * identify any <code>ASObject</code> in this map.
60      */

61     public ASObject getNamedItemNS(String JavaDoc namespaceURI,
62                                    String JavaDoc localName);
63
64     /**
65      * Returns the <code>index</code>th item in the map. The index starts at
66      * <code>0</code>. If <code>index</code> is greater than or equal to the
67      * number of nodes in the list, this returns <code>null</code>.
68      * @param index The position in the map from which the item is to be
69      * retrieved.
70      * @return The <code>ASObject</code> at the <code>index</code>th position
71      * in the <code>ASNamedObjectMap</code>, or <code>null</code> if that
72      * is not a valid index.
73      */

74     public ASObject item(int index);
75
76     /**
77      * Removes an <code>ASObject</code> specified by a <code>nodeName</code>.
78      * @param name The <code>nodeName</code> of the <code>ASObject</code> to
79      * be removed.
80      * @return The <code>ASObject</code> removed from this map if an
81      * <code>ASObject</code> with such a name exists.
82      * @exception DOMException
83      * NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in
84      * this map.
85      * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
86      */

87     public ASObject removeNamedItem(String JavaDoc name)
88                                     throws DOMException JavaDoc;
89
90     /**
91      * Removes an <code>ASObject</code> specified by a namespace URI and a
92      * local name.
93      * @param namespaceURI The namespace URI of the <code>ASObject</code> to
94      * be removed.
95      * @param localName The local name of the <code>ASObject</code> to remove.
96      * @return The <code>ASObject</code> removed from this map if an
97      * <code>ASObject</code> with such a local name and namespace URI
98      * exists.
99      * @exception DOMException
100      * NOT_FOUND_ERR: Raised if there is no node with the specified
101      * <code>namespaceURI</code> and <code>localName</code> in this map.
102      * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
103      */

104     public ASObject removeNamedItemNS(String JavaDoc namespaceURI,
105                                       String JavaDoc localName)
106                                       throws DOMException JavaDoc;
107
108     /**
109      * Adds an <code>ASObject</code> using its <code>nodeName</code>
110      * attribute. If an <code>ASObject</code> with that name is already
111      * present in this map, it is replaced by the new one.
112      * @param newASObject The <code>ASObject</code> to be inserted in the map
113      * with its <code>nodeName</code> as the key.
114      * @return If the new node replaces an existing one, the replaced node is
115      * returned, otherwise <code>null</code>.
116      * @exception DOMException
117      * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a
118      * different <code>ASModel</code> than the one that created this map.
119      * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
120      * <br>HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node
121      * doesn't belong in this <code>ASNamedObjectMap</code>.
122      */

123     public ASObject setNamedItem(ASObject newASObject)
124                                  throws DOMException JavaDoc;
125
126     /**
127      * Adds an <code>ASObject</code> using its <code>namespaceURI</code> and
128      * <code>localName</code>. If an <code>ASObject</code> with the same
129      * <code>namespaceURI</code> and <code>localName</code> is already
130      * present in this map, it is replaced by the new one.
131      * @param newASObject The <code>ASObject</code> to be inserted in the
132      * map.The <code>ASObject</code> will later be accessible using the
133      * value of its <code>namespaceURI</code> and <code>localName</code>
134      * attributes.
135      * @return If the new node replaces an existing one, the replaced node is
136      * returned, otherwise <code>null</code>.
137      * @exception DOMException
138      * <code>WRONG_DOCUMENT_ERR</code>: Raised if <code>arg</code> was
139      * created from a different <code>ASModel</code> than the one that
140      * created this map.
141      * <br><code>NO_MODIFICATION_ALLOWED_ERR</code>: Raised if this map is
142      * readonly.
143      * <br><code>HIERARCHY_REQUEST_ERR</code>: Raised if an attempt is made
144      * to add a node doesn't belong in this <code>ASNamedObjectMap</code>.
145      */

146     public ASObject setNamedItemNS(ASObject newASObject)
147                                    throws DOMException JavaDoc;
148
149 }
150
Popular Tags