public class MultithreadedItemMappingIterator extends ItemMappingIterator
SequenceIterator.Property
Constructor and Description |
---|
MultithreadedItemMappingIterator(SequenceIterator base,
ItemMappingFunction action,
MultithreadingFactory factory) |
Modifier and Type | Method and Description |
---|---|
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 . |
protected int |
getMaxThreads()
Overridable method that decides how many threads to use.
|
Item |
next()
Get the next item in the sequence.
|
getBaseIterator, getLength, getMappingFunction, getProperties, hasNext, isOneToOne, setOneToOne
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachOrFail, materialize
public MultithreadedItemMappingIterator(SequenceIterator base, ItemMappingFunction action, MultithreadingFactory factory) throws XPathException
XPathException
protected int getMaxThreads()
Runtime.getRuntime().availableProcessors()
, or 1 if greater.public Item next() throws XPathException
SequenceIterator
next
in interface SequenceIterator
next
in class ItemMappingIterator
XPathException
- if an error occurs retrieving the next itempublic void close()
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.close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface SequenceIterator
close
in class ItemMappingIterator
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.