annotate NGSrich_0.5.5/src/org/jdom/Parent.java @ 0:89ad0a9cca52 default tip

Uploaded
author pfrommolt
date Mon, 21 Nov 2011 08:12:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
1 /*--
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
2
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
3 $Id: Parent.java,v 1.13 2007/11/10 05:28:59 jhunter Exp $
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
4
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
5 Copyright (C) 2000-2007 Jason Hunter & Brett McLaughlin.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
6 All rights reserved.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
7
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
8 Redistribution and use in source and binary forms, with or without
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
9 modification, are permitted provided that the following conditions
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
10 are met:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
11
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
12 1. Redistributions of source code must retain the above copyright
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
13 notice, this list of conditions, and the following disclaimer.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
14
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
15 2. Redistributions in binary form must reproduce the above copyright
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
16 notice, this list of conditions, and the disclaimer that follows
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
17 these conditions in the documentation and/or other materials
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
18 provided with the distribution.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
19
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
20 3. The name "JDOM" must not be used to endorse or promote products
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
21 derived from this software without prior written permission. For
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
22 written permission, please contact <request_AT_jdom_DOT_org>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
23
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
24 4. Products derived from this software may not be called "JDOM", nor
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
25 may "JDOM" appear in their name, without prior written permission
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
26 from the JDOM Project Management <request_AT_jdom_DOT_org>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
27
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
28 In addition, we request (but do not require) that you include in the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
29 end-user documentation provided with the redistribution and/or in the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
30 software itself an acknowledgement equivalent to the following:
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
31 "This product includes software developed by the
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
32 JDOM Project (http://www.jdom.org/)."
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
33 Alternatively, the acknowledgment may be graphical using the logos
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
34 available at http://www.jdom.org/images/logos.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
35
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
36 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
37 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
38 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
39 DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
40 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
41 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
42 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
43 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
44 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
45 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
46 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
47 SUCH DAMAGE.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
48
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
49 This software consists of voluntary contributions made by many
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
50 individuals on behalf of the JDOM Project and was originally
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
51 created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
52 Brett McLaughlin <brett_AT_jdom_DOT_org>. For more information
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
53 on the JDOM Project, please see <http://www.jdom.org/>.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
54
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
55 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
56
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
57 package org.jdom;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
58
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
59 import java.io.Serializable;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
60 import java.util.*;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
61 import org.jdom.filter.Filter;
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
62
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
63 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
64 * Superclass for JDOM objects which are allowed to contain
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
65 * {@link Content} content.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
66 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
67 * @see org.jdom.Content
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
68 * @see org.jdom.Document
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
69 * @see org.jdom.Element
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
70 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
71 * @author Bradley S. Huffman
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
72 * @author Jason Hunter
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
73 * @version $Revision: 1.13 $, $Date: 2007/11/10 05:28:59 $
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
74 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
75 public interface Parent extends Cloneable, Serializable {
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
76
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
77 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
78 * Returns the number of children in this parent's content list.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
79 * Children may be any {@link Content} type.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
80 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
81 * @return number of children
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
82 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
83 int getContentSize();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
84
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
85 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
86 * Returns the index of the supplied child in the content list,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
87 * or -1 if not a child of this parent.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
88 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
89 * @param child child to search for
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
90 * @return index of child, or -1 if not found
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
91 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
92 int indexOf(Content child);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
93
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
94 // /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
95 // * Starting at the given index (inclusive), returns the index of
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
96 // * the first child matching the supplied filter, or -1
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
97 // * if none is found.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
98 // *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
99 // * @return index of child, or -1 if none found
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
100 // */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
101 // int indexOf(int index, Filter filter);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
102
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
103 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
104 * Returns a list containing detached clones of this parent's content list.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
105 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
106 * @return list of cloned child content
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
107 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
108 List cloneContent();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
109
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
110 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
111 * Returns the child at the given index.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
112 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
113 * @param index location of desired child
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
114 * @return child at the given index
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
115 * @throws IndexOutOfBoundsException if index is negative or beyond
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
116 * the current number of children
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
117 * @throws IllegalStateException if parent is a Document
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
118 * and the root element is not set
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
119 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
120 Content getContent(int index);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
121
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
122 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
123 * Returns the full content of this parent as a {@link java.util.List}
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
124 * which contains objects of type {@link Content}. The returned list is
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
125 * <b>"live"</b> and in document order. Any modifications
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
126 * to it affect the element's actual contents. Modifications are checked
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
127 * for conformance to XML 1.0 rules.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
128 * <p>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
129 * Sequential traversal through the List is best done with an Iterator
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
130 * since the underlying implement of {@link java.util.List#size} may
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
131 * require walking the entire list and indexed lookups may require
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
132 * starting at the beginning each time.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
133 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
134 * @return a list of the content of the parent
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
135 * @throws IllegalStateException if parent is a Document
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
136 * and the root element is not set
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
137 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
138 List getContent();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
139
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
140 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
141 * Returns as a {@link java.util.List} the content of
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
142 * this parent that matches the supplied filter. The returned list is
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
143 * <b>"live"</b> and in document order. Any modifications to it affect
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
144 * the element's actual contents. Modifications are checked for
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
145 * conformance to XML 1.0 rules.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
146 * <p>
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
147 * Sequential traversal through the List is best done with an Iterator
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
148 * since the underlying implement of {@link java.util.List#size} may
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
149 * require walking the entire list and indexed lookups may require
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
150 * starting at the beginning each time.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
151 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
152 * @param filter filter to apply
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
153 * @return a list of the content of the parent matching the filter
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
154 * @throws IllegalStateException if parent is a Document
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
155 * and the root element is not set
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
156 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
157 List getContent(Filter filter);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
158
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
159 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
160 * Removes all content from this parent and returns the detached
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
161 * children.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
162 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
163 * @return list of the old content detached from this parent
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
164 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
165 List removeContent();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
166
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
167 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
168 * Removes from this parent all child content matching the given filter
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
169 * and returns a list of the detached children.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
170 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
171 * @param filter filter to apply
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
172 * @return list of the detached children matching the filter
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
173 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
174 List removeContent(Filter filter);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
175
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
176 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
177 * Removes a single child node from the content list.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
178 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
179 * @param child child to remove
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
180 * @return whether the removal occurred
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
181 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
182 boolean removeContent(Content child);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
183
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
184 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
185 * Removes and returns the child at the given
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
186 * index, or returns null if there's no such child.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
187 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
188 * @param index index of child to remove
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
189 * @return detached child at given index or null if no
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
190 * @throws IndexOutOfBoundsException if index is negative or beyond
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
191 * the current number of children
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
192 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
193 Content removeContent(int index);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
194
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
195 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
196 * Obtain a deep, unattached copy of this parent and it's children.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
197 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
198 * @return a deep copy of this parent and it's children.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
199 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
200 Object clone();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
201
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
202 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
203 * Returns an {@link java.util.Iterator} that walks over all descendants
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
204 * in document order.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
205 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
206 * @return an iterator to walk descendants
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
207 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
208 Iterator getDescendants();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
209
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
210 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
211 * Returns an {@link java.util.Iterator} that walks over all descendants
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
212 * in document order applying the Filter to return only elements that
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
213 * match the filter rule. With filters you can match only Elements,
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
214 * only Comments, Elements or Comments, only Elements with a given name
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
215 * and/or prefix, and so on.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
216 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
217 * @param filter filter to select which descendants to see
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
218 * @return an iterator to walk descendants that match a filter
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
219 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
220 Iterator getDescendants(Filter filter);
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
221
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
222 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
223 * Return this parent's parent, or null if this parent is currently
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
224 * not attached to another parent. This is the same method as in Content but
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
225 * also added to Parent to allow more easy up-the-tree walking.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
226 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
227 * @return this parent's parent or null if none
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
228 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
229 Parent getParent();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
230
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
231 /**
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
232 * Return this parent's owning document or null if the branch containing
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
233 * this parent is currently not attached to a document.
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
234 *
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
235 * @return this child's owning document or null if none
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
236 */
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
237 Document getDocument();
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
238
89ad0a9cca52 Uploaded
pfrommolt
parents:
diff changeset
239 }