it.unimi.di.mg4j.search
Class OrderedAndDocumentIterator
java.lang.Object
it.unimi.di.mg4j.search.AbstractDocumentIterator
it.unimi.di.mg4j.search.AbstractIntervalDocumentIterator
it.unimi.di.mg4j.search.AbstractCompositeDocumentIterator
it.unimi.di.mg4j.search.AbstractIntersectionDocumentIterator
it.unimi.di.mg4j.search.AbstractOrderedIntervalDocumentIterator
it.unimi.di.mg4j.search.OrderedAndDocumentIterator
- All Implemented Interfaces:
- DocumentIterator
public class OrderedAndDocumentIterator
- extends AbstractOrderedIntervalDocumentIterator
An iterator returning documents containing nonoverlapping intervals in query order
satisfying the underlying queries.
In practice, this iterator implements strictly ordered AND, which is
satisfied when the subqueries are satisfied by nonoverlapping intervals in query order.
OrderedAndDocumentIterator
protected OrderedAndDocumentIterator(Object arg,
DocumentIterator[] documentIterator)
getInstance
public static DocumentIterator getInstance(Index index,
DocumentIterator... documentIterator)
throws IOException
- Returns a document iterator that computes the ordered AND 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 ordered AND of
it
.
- Throws:
IOException
getInstance
public static DocumentIterator getInstance(DocumentIterator... documentIterator)
throws IOException
- Returns a document iterator that computes the ordered AND 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 (at least one).
- Returns:
- a document iterator that computes the ordered AND of
it
.
- Throws:
IOException
getIntervalIterator
protected IntervalIterator getIntervalIterator(Index unused,
int n,
boolean allIndexIterators,
Object unusedArg)
- Description copied from class:
AbstractIntervalDocumentIterator
- Creates an interval iterator suitable for this
AbstractIntervalDocumentIterator
.
- Specified by:
getIntervalIterator
in class AbstractIntervalDocumentIterator
- Parameters:
unused
- the reference index for the iterator, or null
.n
- the number of underlying or component iterators.allIndexIterators
- whether all underlying or component iterators are index iterators.unusedArg
- an optional argument.
- Returns:
- an interval iterator suitable for this
AbstractIntervalDocumentIterator
.