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

    Modifier and Type Method Description
    boolean hasNext()
    Checks if we can advance the iterator.
    Posting next()
    Advances the posting list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove
  • Field Details

    • postings

      protected org.apache.lucene.index.PostingsEnum postings
      The posting list.
    • currentDoc

      protected int currentDoc
      Current document for the iterator.
  • Constructor Details

    • LucenePostingsIterator

      public LucenePostingsIterator​(org.apache.lucene.index.PostingsEnum p) throws java.io.IOException
      Constructor.
      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 interface java.util.Iterator<Posting>
      Returns:
      true if there is a next posting, false otherwise.
    • next

      public Posting next()
      Advances the posting list.
      Specified by:
      next in interface java.util.Iterator<Posting>
      Returns:
      the next posting in the list.