Parallel-processing version of the ItemMappingIterator class, which executes a mapping function
for each item in a sequence. In this implementation (which is designed initially for use
by the collection() function), the order of items in the result sequence retains
the order of items in the input sequence.
the next item, or null if there are no more items. Once a call
on next() has returned null, no further calls should be made. The preferred
action for an iterator if subsequent calls on next() are made is to return
null again, and all implementations within Saxon follow this rule.
public void close()
The user of a SequenceIterator is encouraged to call the close() method if
no further items are required from the sequence of items delivered by the SequenceIterator.
This allows resources to be released. A SequenceIterator is NOT normally closed explicitly
if it has been read to completion. This implementation of the close() method shuts down
the ExecutorService used to schedule threads.
Calling this method instructs the iterator to release any resources it holds, while still
remaining able to deliver the remaining items in the sequence. This may require
the iterator to calculate the rest of the sequence eagerly. The method is called by a client
if it anticipates that it might not read the iterator to completion, but it cannot
guarantee that SequenceIterator.close() will be called when no more items are needed.