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