it.unimi.dsi.mg4j.search
Class AbstractOrderedIntervalDocumentIterator
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.AbstractIntersectionDocumentIterator
it.unimi.dsi.mg4j.search.AbstractOrderedIntervalDocumentIterator
- All Implemented Interfaces:
- IntIterator, DocumentIterator, Iterable<Interval>, Iterator<Integer>
- Direct Known Subclasses:
- ConsecutiveDocumentIterator, OrderedAndDocumentIterator
public abstract class AbstractOrderedIntervalDocumentIterator
- extends AbstractIntersectionDocumentIterator
An abstract document iterator helping in the implementation of ConsecutiveDocumentIterator
and OrderedAndDocumentIterator.
| Methods inherited from interface it.unimi.dsi.fastutil.ints.IntIterator |
skip |
DEBUG
public static final boolean DEBUG
- See Also:
- Constant Field Values
ASSERTS
public static final boolean ASSERTS
- See Also:
- Constant Field Values
AbstractOrderedIntervalDocumentIterator
protected AbstractOrderedIntervalDocumentIterator(DocumentIterator[] documentIterator)
throws IOException
- Creates a new abstract document iterator.
- Parameters:
documentIterator - the underlying document iterators (at least one). The must all return the same
singleton set as DocumentIterator.indices().
- Throws:
IOException
nextDocumentInternal
protected int nextDocumentInternal()
throws IOException
- Overrides:
nextDocumentInternal in class AbstractIntersectionDocumentIterator
- Throws:
IOException
skipTo
public int skipTo(int n)
throws IOException
- Description copied from interface:
DocumentIterator
- Skips all documents smaller than
n. If Iterator.hasNext() has been called returning
true but DocumentIterator.nextDocument() has not been called afterwards, then a call
to DocumentIterator.skipTo(int) will be implicitly preceded by
a call to DocumentIterator.nextDocument() (the only consequence is that skipping to the current
document after a call to Iterator.hasNext() will return the next document).
Define the current document k associated with this document iterator
as follows:
If k is larger than or equal to n, then
this method does nothing and returns k. Otherwise, a
call to this method is equivalent to
while( ( k = nextDocument() ) < n && k != -1 );
return k == -1 ? END_OF_LIST : k;
Thus, when a result k ≠ DocumentIterator.END_OF_LIST
is returned, the state of this iterator
will be exactly the same as after a call to DocumentIterator.nextDocument()
that returned k.
In particular, the first document larger than or equal to n (when returned
by this method) will not be returned by the next call to
DocumentIterator.nextDocument().
- Specified by:
skipTo in interface DocumentIterator- Overrides:
skipTo in class AbstractIntersectionDocumentIterator
- Parameters:
n - a document pointer.
- Returns:
- a document pointer larger than or equal to
n if available, DocumentIterator.END_OF_LIST
otherwise.
- Throws:
IOException