01: package net.sf.saxon.tree;
02:
03: import net.sf.saxon.om.SequenceIterator;
04: import net.sf.saxon.pattern.NodeTest;
05:
06: final class PrecedingOrAncestorEnumeration extends TreeEnumeration {
07:
08: /**
09: * This axis cannot be requested directly in an XPath expression
10: * but is used when evaluating xsl:number. It is provided because
11: * taking the union of the two axes would be very inefficient
12: */
13:
14: public PrecedingOrAncestorEnumeration(NodeImpl node,
15: NodeTest nodeTest) {
16: super (node, nodeTest);
17: advance();
18: }
19:
20: protected void step() {
21: next = next.getPreviousInDocument();
22: }
23:
24: /**
25: * Get another enumeration of the same nodes
26: */
27:
28: public SequenceIterator getAnother() {
29: return new PrecedingOrAncestorEnumeration(start, nodeTest);
30: }
31:
32: }
33:
34: //
35: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
36: // you may not use this file except in compliance with the License. You may obtain a copy of the
37: // License at http://www.mozilla.org/MPL/
38: //
39: // Software distributed under the License is distributed on an "AS IS" basis,
40: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
41: // See the License for the specific language governing rights and limitations under the License.
42: //
43: // The Original Code is: all this file.
44: //
45: // The Initial Developer of the Original Code is Michael H. Kay.
46: //
47: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
48: //
49: // Contributor(s): none.
50: //
|