org.apache.lucene.index
Class TermEnum
- java.lang.Object
-
- org.apache.lucene.index.TermEnum
-
- Direct Known Subclasses:
- FilteredTermEnum, FilterIndexReader.FilterTermEnum
public abstract class TermEnum extends java.lang.ObjectAbstract 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 voidclose()Closes the enumeration to further activity, freeing resources.abstract intdocFreq()Returns the docFreq of the current Term in the enumeration.abstract booleannext()Increments the enumeration to the next element.booleanskipTo(Term target)Skips terms to the first beyond the current whose value is greater or equal to target.abstract Termterm()Returns the current Term in the enumeration.
-
-
-
Method Detail
-
next
public abstract boolean next() throws java.io.IOExceptionIncrements 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.IOExceptionCloses 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