Documentation of 'org.apache.lucene.index.TermEnum' Java class
TermEnum
org.apache.lucene.index

Class TermEnum

  • Direct Known Subclasses:
    FilteredTermEnum, FilterIndexReader.FilterTermEnum


    public abstract class TermEnum
    extends java.lang.Object
    Abstract class for enumerating terms.

    Term enumerations are always ordered by Term.compareTo(). Each term in the enumeration is greater than all that precede it.

    • Constructor Summary

      Constructors 
      Constructor and Description
      TermEnum() 
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      abstract void close()
      Closes the enumeration to further activity, freeing resources.
      abstract int docFreq()
      Returns the docFreq of the current Term in the enumeration.
      abstract boolean next()
      Increments the enumeration to the next element.
      boolean skipTo(Term target)
      Skips terms to the first beyond the current whose value is greater or equal to target.
      abstract Term term()
      Returns the current Term in the enumeration.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TermEnum

        public TermEnum()
    • Method Detail

      • next

        public abstract boolean next()
                              throws java.io.IOException
        Increments the enumeration to the next element. True if one exists.
        Throws:
        java.io.IOException
      • term

        public abstract Term term()
        Returns the current Term in the enumeration.
      • docFreq

        public abstract int docFreq()
        Returns the docFreq of the current Term in the enumeration.
      • close

        public abstract void close()
                            throws java.io.IOException
        Closes the enumeration to further activity, freeing resources.
        Throws:
        java.io.IOException
      • skipTo

        public boolean skipTo(Term target)
                       throws java.io.IOException
        Skips terms to the first beyond the current whose value is greater or equal to target.

        Returns true iff there is such an entry.

        Behaves as if written:

           public boolean skipTo(Term target) {
             do {
               if (!next())
                     return false;
             } while (target > term());
             return true;
           }
         
        Some implementations are considerably more efficient than that.
        Throws:
        java.io.IOException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.