Class AxisIteratorImpl
java.lang.Object
net.sf.saxon.om.AxisIteratorImpl
- All Implemented Interfaces:
AtomizableIterator, AxisIterator, SequenceIterator
- Direct Known Subclasses:
AncestorEnumeration, AttributeEnumeration, AttributeEnumeration, DescendantEnumeration, FollowingEnumeration, Navigator.AxisFilter, Navigator.BaseEnumeration, PrecedingEnumeration, PrecedingSiblingEnumeration, SiblingEnumeration
A SequenceIterator is used to iterate over a sequence. An AxisIterator
is a SequenceIterator that always iterates over a set of nodes, and that
throws no exceptions; it also supports the ability
to find the last() position, again with no exceptions.
This class is an abstract implementation of AxisIterator that is used
as a base class for many concrete implementations. The main functionality
that it provides is maintaining the current position.
-
Field Summary
FieldsFields inherited from interface SequenceIterator
ATOMIZABLE, GROUNDED, LAST_POSITION_FINDER, LOOKAHEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Itemcurrent()Get the current node in the sequence.intGet properties of this iterator, as a bit-significant integer.protected final booleanDetermine whether any nodes returned by this iterator will be atomized, in which case the supplier has the option of atomizing them eagerly.final intposition()Get the current positionvoidsetIsAtomizing(boolean atomizing) Indicate that any nodes returned in the sequence will be atomized.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AxisIterator
getAnother, next
-
Field Details
-
position
protected int position -
current
-
-
Constructor Details
-
AxisIteratorImpl
public AxisIteratorImpl()
-
-
Method Details
-
current
Get the current node in the sequence.- Specified by:
currentin interfaceAxisIterator- Specified by:
currentin interfaceSequenceIterator- Returns:
- the node returned by the most recent call on next()
-
position
public final int position()Get the current position- Specified by:
positionin interfaceAxisIterator- Specified by:
positionin interfaceSequenceIterator- Returns:
- the position of the most recent node returned by next()
-
setIsAtomizing
public void setIsAtomizing(boolean atomizing) Indicate that any nodes returned in the sequence will be atomized. This means that if it wishes to do so, the implementation can return the typed values of the nodes rather than the nodes themselves. The implementation is free to ignore this hint.- Specified by:
setIsAtomizingin interfaceAtomizableIterator- Parameters:
atomizing- true if the caller of this iterator will atomize any nodes that are returned, and is therefore willing to accept the typed value of the nodes instead of the nodes themselves.
-
isAtomizing
protected final boolean isAtomizing()Determine whether any nodes returned by this iterator will be atomized, in which case the supplier has the option of atomizing them eagerly. -
getProperties
public int getProperties()Get properties of this iterator, as a bit-significant integer.- Specified by:
getPropertiesin interfaceSequenceIterator- Returns:
- the properties of this iterator. This will be some combination of
properties such as
SequenceIterator.GROUNDED,SequenceIterator.LAST_POSITION_FINDER, andSequenceIterator.LOOKAHEAD. It is always acceptable to return the value zero, indicating that there are no known special properties. It is acceptable for the properties of the iterator to change depending on its state.
-