KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > om > NodeEnumeration


1 package com.icl.saxon.om;
2 import com.icl.saxon.expr.XPathException;
3
4 /**
5 * A NodeEnumeration is used to iterate over a list of nodes. It is very similar to
6 * the standard Java Enumeration interface, except that it throws exceptions and returns
7 * NodeInfo objects rather than general Objects. It also has extra properties allowing the
8 * client to determine whether the nodes are in document order, etc.
9 */

10
11 public interface NodeEnumeration {
12
13     /**
14     * Determine whether there are more nodes to come. <BR>
15     * (Note the term "Element" is used here in the sense of the standard Java Enumeration class,
16     * it has nothing to do with XML elements).
17     * @return true if there are more nodes
18     */

19
20     public boolean hasMoreElements(); //throws XPathException;
21

22     /**
23     * Get the next node in sequence. <BR>
24     * (Note the term "Element" is used here in the sense of the standard Java Enumeration class,
25     * it has nothing to do with XML elements).
26     * @return the next NodeInfo
27     */

28
29     public NodeInfo nextElement() throws XPathException;
30     
31     /**
32     * Determine whether the nodes returned by this enumeration are known to be in document order
33     * @return true if the nodes are guaranteed to be in document order.
34     */

35
36     public boolean isSorted();
37     /**
38     * Determine whether the nodes returned by this enumeration are known to be in
39     * reverse document order.
40     * @return true if the nodes are guaranteed to be in document order.
41     */

42
43     public boolean isReverseSorted();
44
45     /**
46     * Determine whether the nodes returned by this enumeration are known to be peers, that is,
47     * no node is a descendant or ancestor of another node. This significance of this property is
48     * that if a peer enumeration is applied to each node in a set derived from another peer
49     * enumeration, and if both enumerations are sorted, then the result is also sorted.
50     */

51
52     public boolean isPeer();
53
54 }
55
56
57
58 //
59
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
60
// you may not use this file except in compliance with the License. You may obtain a copy of the
61
// License at http://www.mozilla.org/MPL/
62
//
63
// Software distributed under the License is distributed on an "AS IS" basis,
64
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
65
// See the License for the specific language governing rights and limitations under the License.
66
//
67
// The Original Code is: all this file.
68
//
69
// The Initial Developer of the Original Code is
70
// Michael Kay of International Computers Limited (mhkay@iclway.co.uk).
71
//
72
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
73
//
74
// Contributor(s): none.
75
//
76
Popular Tags