net.sf.saxon.om
Class Navigator.BaseEnumeration

java.lang.Object
  |
  +--net.sf.saxon.om.AxisIteratorImpl
        |
        +--net.sf.saxon.om.Navigator.BaseEnumeration
All Implemented Interfaces:
AxisIterator, SequenceIterator
Direct Known Subclasses:
Navigator.AncestorEnumeration, Navigator.DescendantEnumeration, Navigator.FollowingEnumeration, Navigator.PrecedingEnumeration
Enclosing class:
Navigator

public abstract static class Navigator.BaseEnumeration
extends AxisIteratorImpl

BaseEnumeration is an abstract implementation of an AxisIterator, it simplifies the implementation of the underlying AxisIterator by requiring it to provide only two methods: advance(), and getAnother()


Field Summary
protected  NodeInfo next
           
 
Fields inherited from class net.sf.saxon.om.AxisIteratorImpl
current, last, position
 
Constructor Summary
Navigator.BaseEnumeration()
           
 
Method Summary
abstract  void advance()
          The advance() method must be provided in each concrete implementation.
abstract  SequenceIterator getAnother()
          Get another SequenceIterator that iterates over the same items as the original, but which is repositioned at the start of the sequence.
 boolean hasNext()
          Determine whether there are more nodes to come.
 Item next()
          Get the next node in sequence.
 
Methods inherited from class net.sf.saxon.om.AxisIteratorImpl
current, position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

protected NodeInfo next
Constructor Detail

Navigator.BaseEnumeration

public Navigator.BaseEnumeration()
Method Detail

hasNext

public final boolean hasNext()
Description copied from class: AxisIteratorImpl
Determine whether there are more nodes to come.

Specified by:
hasNext in interface AxisIterator
Specified by:
hasNext in class AxisIteratorImpl
Returns:
true if there are more nodes

next

public final Item next()
Description copied from class: AxisIteratorImpl
Get the next node in sequence. The implementation of this method must return the next node; it must also set the variable current to this node, and the variable position to the position of the node.

Specified by:
next in interface AxisIterator
Specified by:
next in class AxisIteratorImpl
Returns:
the next NodeInfo

advance

public abstract void advance()
The advance() method must be provided in each concrete implementation. It must leave the variable next set to the next node to be returned in the iteration, or to null if there are no more nodes to be returned.


getAnother

public abstract SequenceIterator getAnother()
Description copied from interface: SequenceIterator
Get another SequenceIterator that iterates over the same items as the original, but which is repositioned at the start of the sequence.

Returns:
a SequenceIterator that iterates over the same items, positioned before the first item