Package org.apache.lucene.search
Class SingleTermEnum
- java.lang.Object
-
- org.apache.lucene.index.TermEnum
-
- org.apache.lucene.search.FilteredTermEnum
-
- org.apache.lucene.search.SingleTermEnum
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class SingleTermEnum extends FilteredTermEnum
Subclass of FilteredTermEnum for enumerating a single term.This can be used by
MultiTermQuerys that need only visit one term, but want to preserve MultiTermQuery semantics such asMultiTermQuery.rewriteMethod.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.search.FilteredTermEnum
actualEnum, currentTerm
-
-
Constructor Summary
Constructors Constructor Description SingleTermEnum(IndexReader reader, Term singleTerm)Creates a newSingleTermEnum.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatdifference()Equality measure on the termprotected booleanendEnum()Indicates the end of the enumeration has been reachedprotected booleantermCompare(Term term)Equality compare on the term
-
-
-
Constructor Detail
-
SingleTermEnum
public SingleTermEnum(IndexReader reader, Term singleTerm) throws IOException
Creates a newSingleTermEnum.After calling the constructor the enumeration is already pointing to the term, if it exists.
- Throws:
IOException
-
-
Method Detail
-
difference
public float difference()
Description copied from class:FilteredTermEnumEquality measure on the term- Specified by:
differencein classFilteredTermEnum
-
endEnum
protected boolean endEnum()
Description copied from class:FilteredTermEnumIndicates the end of the enumeration has been reached- Specified by:
endEnumin classFilteredTermEnum
-
termCompare
protected boolean termCompare(Term term)
Description copied from class:FilteredTermEnumEquality compare on the term- Specified by:
termComparein classFilteredTermEnum
-
-