net.sf.saxon.om
Class EmptyIterator
java.lang.Object
net.sf.saxon.om.EmptyIterator
- AxisIterator, GroundedIterator, LastPositionFinder, LookaheadIterator, ReversibleIterator, SequenceIterator, UnfailingIterator
public class EmptyIterator
extends java.lang.Object
EmptyIterator: an iterator over an empty sequence. Since such an iterator has no state,
only one instance is required; therefore a singleton instance is available via the static
getInstance() method.
getInstance
public static EmptyIterator getInstance()
Get an EmptyIterator, an iterator over an empty sequence.
- an EmptyIterator (in practice, this always returns the same
one)
getLastPosition
public int getLastPosition()
Get the position of the last item in the sequence.
- getLastPosition in interface LastPositionFinder
- the position of the last item in the sequence, always zero in
this implementation
getProperties
public int getProperties()
Get properties of this iterator, as a bit-significant integer.
- getProperties in interface SequenceIterator
getReverseIterator
public SequenceIterator getReverseIterator()
Get another iterator over the same items, in reverse order.
- getReverseIterator in interface ReversibleIterator
- a reverse iterator over an empty sequence (in practice, it
returns the same iterator each time)
getStringValue
public CharSequence getStringValue()
Return the string value of the current node.
- getStringValue in interface AxisIterator
- the string value, as an instance of CharSequence.
hasNext
public boolean hasNext()
Determine whether there are more items to come. Note that this operation
is stateless and it is not necessary (or usual) to call it before calling
next(). It is used only when there is an explicit need to tell if we
are at the last element.
- hasNext in interface LookaheadIterator
- true if there are more nodes
iterateAxis
public AxisIterator iterateAxis(byte axis,
NodeTest test)
Return an iterator over an axis, starting at the current node.
- iterateAxis in interface AxisIterator
axis
- the axis to iterate over, using a constant such as
Axis.CHILD
test
- a predicate to apply to the nodes before returning them.
materialize
public GroundedValue materialize()
Return a Value containing all the items in the sequence returned by this
SequenceIterator. This should be an "in-memory" value, not a Closure.
- materialize in interface GroundedIterator
moveNext
public boolean moveNext()
Move to the next node, without returning it. Returns true if there is
a next node, false if the end of the sequence has been reached. After
calling this method, the current node may be retrieved using the
current() function.
- moveNext in interface AxisIterator
position
public int position()
Get the position of the current item.
- position in interface UnfailingIterator
- position in interface SequenceIterator
- the position of the current item. For the EmptyIterator this is always zero
(whether or not the next() method has been called).