Package org.apache.lucene.search
Class FilteredTermEnum
- java.lang.Object
-
- org.apache.lucene.index.TermEnum
-
- org.apache.lucene.search.FilteredTermEnum
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
FuzzyTermEnum,PrefixTermEnum,RegexTermEnum,SingleTermEnum,TermRangeTermEnum,WildcardTermEnum
public abstract class FilteredTermEnum extends TermEnum
Abstract class for enumerating a subset of all terms.Term enumerations are always ordered by Term.compareTo(). Each term in the enumeration is greater than all that precede it.
-
-
Field Summary
Fields Modifier and Type Field Description protected TermEnumactualEnumthe delegate enum - to set this member usesetEnum(org.apache.lucene.index.TermEnum)protected TermcurrentTermthe current term
-
Constructor Summary
Constructors Constructor Description FilteredTermEnum()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the enumeration to further activity, freeing resources.abstract floatdifference()Equality measure on the termintdocFreq()Returns the docFreq of the current Term in the enumeration.protected abstract booleanendEnum()Indicates the end of the enumeration has been reachedbooleannext()Increments the enumeration to the next element.protected voidsetEnum(TermEnum actualEnum)use this method to set the actual TermEnum (e.g.Termterm()Returns the current Term in the enumeration.protected abstract booleantermCompare(Term term)Equality compare on the term
-
-
-
Field Detail
-
currentTerm
protected Term currentTerm
the current term
-
actualEnum
protected TermEnum actualEnum
the delegate enum - to set this member usesetEnum(org.apache.lucene.index.TermEnum)
-
-
Method Detail
-
termCompare
protected abstract boolean termCompare(Term term)
Equality compare on the term
-
difference
public abstract float difference()
Equality measure on the term
-
endEnum
protected abstract boolean endEnum()
Indicates the end of the enumeration has been reached
-
setEnum
protected void setEnum(TermEnum actualEnum) throws IOException
use this method to set the actual TermEnum (e.g. in ctor), it will be automatically positioned on the first matching term.- Throws:
IOException
-
docFreq
public int docFreq()
Returns the docFreq of the current Term in the enumeration. Returns -1 if no Term matches or all terms have been enumerated.
-
next
public boolean next() throws IOExceptionIncrements the enumeration to the next element. True if one exists.- Specified by:
nextin classTermEnum- Throws:
IOException
-
term
public Term term()
Returns the current Term in the enumeration. Returns null if no Term matches or all terms have been enumerated.
-
close
public void close() throws IOExceptionCloses the enumeration to further activity, freeing resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classTermEnum- Throws:
IOException
-
-