01: package net.sf.saxon.om;
02:
03: /**
04: * A SequenceIterator is used to iterate over a sequence. An AxisIterator
05: * is a SequenceIterator that throws no exceptions.
06: * Despite its name, an AxisIterator is not invariably used to find nodes
07: * on an axis of a tree, though this is its most common use. For example, the
08: * class ArrayIterator is also defined as an AxisIterator.
09: */
10:
11: public interface AxisIterator extends SequenceIterator {
12:
13: /**
14: * Get the next item in the sequence. <BR>
15: * @return the next Item. If there are no more nodes, return null.
16: */
17:
18: public Item next();
19:
20: /**
21: * Get the current item in the sequence.
22: *
23: * @return the current item, that is, the item most recently returned by
24: * next()
25: */
26:
27: public Item current();
28:
29: /**
30: * Get the current position
31: *
32: * @return the position of the current item (the item most recently
33: * returned by next()), starting at 1 for the first node
34: */
35:
36: public int position();
37:
38: /**
39: * Get another iterator over the same sequence of items, positioned at the
40: * start of the sequence. It must be possible to call this method at any time, whether
41: * none, some, or all of the items in the original iterator have been read. The method
42: * is non-destructive: it does not change the state of the original iterator.
43: * @return a new iterator over the same sequence
44: */
45:
46: public SequenceIterator getAnother();
47:
48: }
49:
50: //
51: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
52: // you may not use this file except in compliance with the License. You may obtain a copy of the
53: // License at http://www.mozilla.org/MPL/
54: //
55: // Software distributed under the License is distributed on an "AS IS" basis,
56: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
57: // See the License for the specific language governing rights and limitations under the License.
58: //
59: // The Original Code is: all this file.
60: //
61: // The Initial Developer of the Original Code is Michael H. Kay.
62: //
63: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
64: //
65: // Contributor(s): none.
66: //
|