KickJava   Java API By Example, From Geeks To Geeks.

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


1 package net.sf.saxon.tree;
2 import net.sf.saxon.om.SequenceIterator;
3 import net.sf.saxon.pattern.NodeTest;
4
5 final class PrecedingOrAncestorEnumeration extends TreeEnumeration {
6
7     /**
8     * This axis cannot be requested directly in an XPath expression
9     * but is used when evaluating xsl:number. It is provided because
10     * taking the union of the two axes would be very inefficient
11     */

12
13    
14     public PrecedingOrAncestorEnumeration(NodeImpl node, NodeTest nodeTest) {
15         super(node, nodeTest);
16         advance();
17     }
18
19     protected void step() {
20         next = next.getPreviousInDocument();
21     }
22
23     /**
24     * Get another enumeration of the same nodes
25     */

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