KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > tree > FollowingSiblingEnumeration


1 package com.icl.saxon.tree;
2 import com.icl.saxon.pattern.NodeTest;
3
4 final class FollowingSiblingEnumeration extends TreeEnumeration {
5     
6     public FollowingSiblingEnumeration(NodeImpl node, NodeTest nodeTest) {
7         super(node, nodeTest);
8         advance();
9     }
10
11     protected void step() {
12         next = (NodeImpl)next.getNextSibling();
13     }
14
15     public boolean isSorted() {
16         return true;
17     }
18
19     /**
20     * Get the last position, that is the number of nodes in the enumeration
21     */

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