Package it.unimi.di.big.mg4j.search
Class OrderedAndDocumentIterator
- java.lang.Object
-
- it.unimi.di.big.mg4j.search.AbstractDocumentIterator
-
- it.unimi.di.big.mg4j.search.AbstractIntervalDocumentIterator
-
- it.unimi.di.big.mg4j.search.AbstractCompositeDocumentIterator
-
- it.unimi.di.big.mg4j.search.AbstractIntersectionDocumentIterator
-
- it.unimi.di.big.mg4j.search.AbstractOrderedIntervalDocumentIterator
-
- it.unimi.di.big.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
OrderedAndDocumentIterator.OrderedAndIndexIntervalIterator
protected class
OrderedAndDocumentIterator.OrderedAndIntervalIterator
-
Nested classes/interfaces inherited from class it.unimi.di.big.mg4j.search.AbstractCompositeDocumentIterator
AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator, AbstractCompositeDocumentIterator.AbstractCompositeIntervalIterator
-
-
Field Summary
-
Fields inherited from class it.unimi.di.big.mg4j.search.AbstractIntersectionDocumentIterator
lastIterator, sortedIterator
-
Fields inherited from class it.unimi.di.big.mg4j.search.AbstractCompositeDocumentIterator
documentIterator, indexIterator, indexIteratorsWithoutPositions, n
-
Fields inherited from class it.unimi.di.big.mg4j.search.AbstractIntervalDocumentIterator
currentIterators, indices, intervalIterators, soleIndex, soleIntervalIterator, unmodifiableCurrentIterators
-
Fields inherited from class it.unimi.di.big.mg4j.search.AbstractDocumentIterator
curr, weight
-
Fields inherited from interface it.unimi.di.big.mg4j.search.DocumentIterator
END_OF_LIST
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
OrderedAndDocumentIterator(Object arg, DocumentIterator[] documentIterator)
-
Method Summary
Modifier and Type Method Description static DocumentIterator
getInstance(Index index, DocumentIterator... documentIterator)
Returns a document iterator that computes the ordered AND of the given array of iterators.static DocumentIterator
getInstance(DocumentIterator... documentIterator)
Returns a document iterator that computes the ordered AND of the given nonzero-length array of iterators.protected IntervalIterator
getIntervalIterator(Index unused, int n, boolean allIndexIterators, Object unusedArg)
Creates an interval iterator suitable for thisAbstractIntervalDocumentIterator
.-
Methods inherited from class it.unimi.di.big.mg4j.search.AbstractOrderedIntervalDocumentIterator
intervalIterator, intervalIterator, intervalIterators, nextDocument, skipTo
-
Methods inherited from class it.unimi.di.big.mg4j.search.AbstractIntersectionDocumentIterator
align
-
Methods inherited from class it.unimi.di.big.mg4j.search.AbstractCompositeDocumentIterator
accept, acceptOnTruePaths, dispose, toString
-
Methods inherited from class it.unimi.di.big.mg4j.search.AbstractIntervalDocumentIterator
allIndexIterators, indices, indices
-
Methods inherited from class it.unimi.di.big.mg4j.search.AbstractDocumentIterator
document, ensureOnADocument, mayHaveNext, weight, weight
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unimi.di.big.mg4j.search.DocumentIterator
document, indices, mayHaveNext, weight, weight
-
-
-
-
Constructor Detail
-
OrderedAndDocumentIterator
protected OrderedAndDocumentIterator(Object arg, DocumentIterator[] documentIterator)
-
-
Method Detail
-
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 ifit
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 thisAbstractIntervalDocumentIterator
.- Specified by:
getIntervalIterator
in classAbstractIntervalDocumentIterator
- Parameters:
unused
- the reference index for the iterator, ornull
.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
.
-
-