Class LucenePostingsIterator
java.lang.Object
es.uam.eps.ir.relison.content.index.structure.lucene.LucenePostingsIterator
- All Implemented Interfaces:
java.util.Iterator<Posting>
- Direct Known Subclasses:
LucenePositionalPostingsIterator
public class LucenePostingsIterator extends java.lang.Object implements java.util.Iterator<Posting>
Iterator of a Lucene posting list.
-
Field Summary
Fields Modifier and Type Field Description protected int
currentDoc
Current document for the iterator.protected org.apache.lucene.index.PostingsEnum
postings
The posting list. -
Constructor Summary
Constructors Constructor Description LucenePostingsIterator(org.apache.lucene.index.PostingsEnum p)
Constructor. -
Method Summary
-
Field Details
-
postings
protected org.apache.lucene.index.PostingsEnum postingsThe posting list. -
currentDoc
protected int currentDocCurrent document for the iterator.
-
-
Constructor Details
-
LucenePostingsIterator
public LucenePostingsIterator(org.apache.lucene.index.PostingsEnum p) throws java.io.IOExceptionConstructor.- Parameters:
p
- the postings.- Throws:
java.io.IOException
- if something fails while reading the posting list.
-
-
Method Details
-
hasNext
public boolean hasNext()Checks if we can advance the iterator.- Specified by:
hasNext
in interfacejava.util.Iterator<Posting>
- Returns:
- true if there is a next posting, false otherwise.
-
next
Advances the posting list.- Specified by:
next
in interfacejava.util.Iterator<Posting>
- Returns:
- the next posting in the list.
-