KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > tree > ChildEnumeration


1 package net.sf.saxon.tree;
2 import net.sf.saxon.om.SequenceIterator;
3 import net.sf.saxon.pattern.NodeTest;
4
5 final class ChildEnumeration extends TreeEnumeration {
6
7     public ChildEnumeration(NodeImpl node, NodeTest nodeTest) {
8         super(node, nodeTest);
9         next = (NodeImpl)node.getFirstChild();
10         while (!conforms(next)) {
11             step();
12         }
13     }
14
15     protected void step() {
16         next = (NodeImpl)next.getNextSibling();
17     }
18
19     /**
20     * Get another enumeration of the same nodes
21     */

22
23     public SequenceIterator getAnother() {
24         return new ChildEnumeration(start, nodeTest);
25     }
26 }
27
28
29 //
30
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
31
// you may not use this file except in compliance with the License. You may obtain a copy of the
32
// License at http://www.mozilla.org/MPL/
33
//
34
// Software distributed under the License is distributed on an "AS IS" basis,
35
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
36
// See the License for the specific language governing rights and limitations under the License.
37
//
38
// The Original Code is: all this file.
39
//
40
// The Initial Developer of the Original Code is Michael H. Kay.
41
//
42
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
43
//
44
// Contributor(s): none.
45
//
46
Popular Tags