it.unimi.dsi.mg4j.search
Class OrderedAndDocumentIterator

java.lang.Object
  extended by it.unimi.dsi.fastutil.ints.AbstractIntIterator
      extended by it.unimi.dsi.mg4j.search.AbstractDocumentIterator
          extended by it.unimi.dsi.mg4j.search.AbstractCompositeDocumentIterator
              extended by it.unimi.dsi.mg4j.search.AbstractIntersectionDocumentIterator
                  extended by it.unimi.dsi.mg4j.search.AbstractOrderedIntervalDocumentIterator
                      extended by it.unimi.dsi.mg4j.search.OrderedAndDocumentIterator
All Implemented Interfaces:
IntIterator, DocumentIterator, Iterable<Interval>, Iterator<Integer>

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/interfaces inherited from class it.unimi.dsi.mg4j.search.AbstractOrderedIntervalDocumentIterator
AbstractOrderedIntervalDocumentIterator.AbstractOrderedIndexIntervalIterator, AbstractOrderedIntervalDocumentIterator.AbstractOrderedIntervalIterator
 
Nested classes/interfaces inherited from class it.unimi.dsi.mg4j.search.AbstractCompositeDocumentIterator
AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator, AbstractCompositeDocumentIterator.AbstractCompositeIntervalIterator
 
Nested classes/interfaces inherited from class it.unimi.dsi.mg4j.search.AbstractDocumentIterator
AbstractDocumentIterator.AbstractIntervalIterator
 
Field Summary
 
Fields inherited from class it.unimi.dsi.mg4j.search.AbstractOrderedIntervalDocumentIterator
DEBUG
 
Fields inherited from class it.unimi.dsi.mg4j.search.AbstractIntersectionDocumentIterator
currentIterators, intervalIterators, unmodifiableCurrentIterators
 
Fields inherited from class it.unimi.dsi.mg4j.search.AbstractCompositeDocumentIterator
documentIterator, indexIterator, indices, n, soleIndex
 
Fields inherited from class it.unimi.dsi.mg4j.search.AbstractDocumentIterator
last, next, weight
 
Constructor Summary
protected OrderedAndDocumentIterator(DocumentIterator[] documentIterator)
           
 
Method Summary
protected  IntervalIterator getComposedIntervalIterator(Index unused)
           
static DocumentIterator getInstance(DocumentIterator... documentIterator)
          Returns a document iterator that computes the ordered AND of the given nonzero-length array of iterators.
static DocumentIterator getInstance(Index index, DocumentIterator... documentIterator)
          Returns a document iterator that computes the ordered AND of the given array of iterators.
 
Methods inherited from class it.unimi.dsi.mg4j.search.AbstractOrderedIntervalDocumentIterator
nextDocument, skipTo
 
Methods inherited from class it.unimi.dsi.mg4j.search.AbstractIntersectionDocumentIterator
intervalIterator, intervalIterators
 
Methods inherited from class it.unimi.dsi.mg4j.search.AbstractCompositeDocumentIterator
accept, acceptOnTruePaths, dispose, indices, intervalIterator, toString
 
Methods inherited from class it.unimi.dsi.mg4j.search.AbstractDocumentIterator
document, hasNext, iterator, nextInt, weight, weight
 
Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntIterator
next, remove, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.mg4j.search.DocumentIterator
document, iterator, nextInt, weight, weight
 
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntIterator
skip
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Constructor Detail

OrderedAndDocumentIterator

protected OrderedAndDocumentIterator(DocumentIterator[] documentIterator)
                              throws IOException
Throws:
IOException
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 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

getComposedIntervalIterator

protected IntervalIterator getComposedIntervalIterator(Index unused)
Specified by:
getComposedIntervalIterator in class AbstractIntersectionDocumentIterator