All Methods Instance Methods Concrete Methods Modifier and Type Method Description
close()Close the iterator.
hasNext()Determine whether there are more items to come.
next()Get the next item in the sequence.
supportsHasNext()Ask whether the hasNext() method can be called.
public UnionEnumeration(SequenceIterator p1, SequenceIterator p2, java.util.Comparator<? super NodeInfo> comparer) throws XPathExceptionCreate the iterator. The two input iterators must return nodes in document order for this to work.
p1- iterator over the first operand sequence (in document order)
p2- iterator over the second operand sequence
comparer- used to test whether nodes are in document order. Different versions are used for intra-document and cross-document operations
XPathException- if an error occurs reading the first item of either operand
public boolean supportsHasNext()Description copied from interface:
LookaheadIteratorAsk whether the hasNext() method can be called. This method must be called before calling hasNext(), because some iterators implement this interface, but only support look-ahead under particular circumstances (this is usually because they delegate to another iterator)
public boolean hasNext()Description copied from interface:
LookaheadIteratorDetermine 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.
This method must not be called unless the result of
public NodeInfo next()Description copied from interface:
SequenceIteratorGet the next item in the sequence. This method changes the state of the iterator.
- Specified by:
public void close()Description copied from interface:
SequenceIterator.next()returns null, the iterator will be closed automatically. An explicit call on
SequenceIterator.close()is needed only when iteration is abandoned prematurely.
$varis passed to a user-written function, the function may access
$varonly; we have no way of knowing whether further items will be read. For this reason, any
SequenceIteratorthat holds resources which need to be closed should use the
Cleaner, and resources held by a
SequenceIteratorshould be registered with the
Cleaner; if the
SequenceIteratoris then garbage-collected without being closed, the
Cleanerwill ensure that the underlying resources are closed. (An example of a
SequenceIteratorthat uses this mechanism is the