Class XFilteredDocIdSetIterator


  • public abstract class XFilteredDocIdSetIterator
    extends org.apache.lucene.search.DocIdSetIterator
    Abstract decorator class of a DocIdSetIterator implementation that provides on-demand filter/validation mechanism on an underlying DocIdSetIterator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.lucene.search.DocIdSetIterator _innerIter  
      • Fields inherited from class org.apache.lucene.search.DocIdSetIterator

        NO_MORE_DOCS
    • Constructor Summary

      Constructors 
      Constructor Description
      XFilteredDocIdSetIterator​(org.apache.lucene.search.DocIdSetIterator innerIter)
      Constructor.
    • Method Summary

      Modifier and Type Method Description
      int advance​(int target)  
      long cost()  
      int docID()  
      org.apache.lucene.search.DocIdSetIterator getDelegate()
      Return the wrapped DocIdSetIterator.
      protected abstract boolean match​(int doc)
      Validation method to determine whether a docid should be in the result set.
      int nextDoc()  
      • Methods inherited from class org.apache.lucene.search.DocIdSetIterator

        all, empty, range, slowAdvance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _innerIter

        protected org.apache.lucene.search.DocIdSetIterator _innerIter
    • Constructor Detail

      • XFilteredDocIdSetIterator

        public XFilteredDocIdSetIterator​(org.apache.lucene.search.DocIdSetIterator innerIter)
        Constructor.
        Parameters:
        innerIter - Underlying DocIdSetIterator.
    • Method Detail

      • getDelegate

        public org.apache.lucene.search.DocIdSetIterator getDelegate()
        Return the wrapped DocIdSetIterator.
      • match

        protected abstract boolean match​(int doc)
        Validation method to determine whether a docid should be in the result set.
        Parameters:
        doc - docid to be tested
        Returns:
        true if input docid should be in the result set, false otherwise.
        Throws:
        org.apache.lucene.search.CollectionTerminatedException - if the underlying iterator is exhausted.
        See Also:
        XFilteredDocIdSetIterator(DocIdSetIterator)
      • docID

        public int docID()
        Specified by:
        docID in class org.apache.lucene.search.DocIdSetIterator
      • nextDoc

        public int nextDoc()
                    throws java.io.IOException
        Specified by:
        nextDoc in class org.apache.lucene.search.DocIdSetIterator
        Throws:
        java.io.IOException
      • advance

        public int advance​(int target)
                    throws java.io.IOException
        Specified by:
        advance in class org.apache.lucene.search.DocIdSetIterator
        Throws:
        java.io.IOException
      • cost

        public long cost()
        Specified by:
        cost in class org.apache.lucene.search.DocIdSetIterator