Class LuceneFreqVectorIterator

java.lang.Object
es.uam.eps.ir.relison.content.index.freq.lucene.LuceneFreqVectorIterator
All Implemented Interfaces:
java.util.Iterator<TermFreq>

public class LuceneFreqVectorIterator
extends java.lang.Object
implements java.util.Iterator<TermFreq>
Iterator for the Lucene frequency vector
  • Field Summary

    Fields 
    Modifier and Type Field Description
    (package private) long pointer
    Pointer of the iterator.
    (package private) long size
    Length of the vector.
    (package private) org.apache.lucene.index.TermsEnum terms
    The frequency vector.
  • Constructor Summary

    Constructors 
    Constructor Description
    LuceneFreqVectorIterator​(org.apache.lucene.index.Terms t)
    Constructor
  • Method Summary

    Modifier and Type Method Description
    long getFreq​(java.lang.String term)
    Given a term, obtains its frequency in the current position.
    boolean hasNext()  
    TermFreq next()  

    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

    • terms

      org.apache.lucene.index.TermsEnum terms
      The frequency vector.
    • size

      long size
      Length of the vector.
    • pointer

      long pointer
      Pointer of the iterator.
  • Constructor Details

    • LuceneFreqVectorIterator

      public LuceneFreqVectorIterator​(org.apache.lucene.index.Terms t) throws java.io.IOException
      Constructor
      Parameters:
      t - terms
      Throws:
      java.io.IOException - if something goes wrong
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface java.util.Iterator<TermFreq>
    • next

      public TermFreq next()
      Specified by:
      next in interface java.util.Iterator<TermFreq>
    • getFreq

      public long getFreq​(java.lang.String term) throws java.io.IOException
      Given a term, obtains its frequency in the current position.
      Parameters:
      term - the term.
      Returns:
      the frequency in the position.
      Throws:
      java.io.IOException - if something fails while retrieving the frequency vector.