it.unimi.dsi.mg4j.search
Class OrDocumentIterator
java.lang.Object
it.unimi.dsi.fastutil.ints.AbstractIntIterator
it.unimi.dsi.mg4j.search.AbstractDocumentIterator
it.unimi.dsi.mg4j.search.AbstractCompositeDocumentIterator
it.unimi.dsi.mg4j.search.AbstractUnionDocumentIterator
it.unimi.dsi.mg4j.search.OrDocumentIterator
- All Implemented Interfaces:
- IntIterator, DocumentIterator, Iterable<Interval>, Iterator<Integer>
public class OrDocumentIterator
- extends AbstractUnionDocumentIterator
- implements DocumentIterator
An iterator on documents that returns the OR of a number of document iterators.
This class adds to AbstractUnionDocumentIterator
an interval iterator generating the OR of the intervals returned for each of the documents involved.
|
Constructor Summary |
protected |
OrDocumentIterator(DocumentIterator... documentIterator)
Creates a new document iterator that computes the OR of the given array of iterators. |
| Methods inherited from interface it.unimi.dsi.mg4j.search.DocumentIterator |
accept, acceptOnTruePaths, document, indices, intervalIterator, intervalIterator, intervalIterators, iterator, nextDocument, nextInt, skipTo, weight, weight |
| Methods inherited from interface it.unimi.dsi.fastutil.ints.IntIterator |
skip |
OrDocumentIterator
protected OrDocumentIterator(DocumentIterator... documentIterator)
throws IOException
- Creates a new document iterator that computes the OR of the given array of iterators.
- Parameters:
documentIterator - the iterators to be joined.
- Throws:
IOException
getInstance
public static DocumentIterator getInstance(Index index,
DocumentIterator... documentIterator)
throws IOException
- Returns a document iterator that computes the OR of the given array of iterators.
Note that the special case of the empty and of the singleton arrays
are handled efficiently.
- Parameters:
index - the default index; relevant only if it has zero length.documentIterator - the iterators to be joined.
- Returns:
- a document iterator that computes the OR of
it.
- Throws:
IOException
getInstance
public static DocumentIterator getInstance(DocumentIterator... documentIterator)
throws IOException
- Returns a document iterator that computes the OR of the given nonzero-length array of iterators.
Note that the special case of the singleton array is handled efficiently.
- Parameters:
documentIterator - the iterators to be joined.
- Returns:
- a document iterator that computes the OR of
it.
- Throws:
IOException
getComposedIntervalIterator
protected IntervalIterator getComposedIntervalIterator(Index index)
- Specified by:
getComposedIntervalIterator in class AbstractUnionDocumentIterator
dispose
public void dispose()
throws IOException
- Description copied from interface:
DocumentIterator
- Disposes this document iterator, releasing all resources.
This method should propagate down to the underlying index iterators, where it should release resources
such as open files and network connections. If you're doing your own resource tracking and pooling,
then you do not need to call this method.
- Specified by:
dispose in interface DocumentIterator- Overrides:
dispose in class AbstractCompositeDocumentIterator
- Throws:
IOException