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
MultiTermQuery
s 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 float
difference()
Equality measure on the termprotected boolean
endEnum()
Indicates the end of the enumeration has been reachedprotected boolean
termCompare(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:FilteredTermEnum
Equality measure on the term- Specified by:
difference
in classFilteredTermEnum
-
endEnum
protected boolean endEnum()
Description copied from class:FilteredTermEnum
Indicates the end of the enumeration has been reached- Specified by:
endEnum
in classFilteredTermEnum
-
termCompare
protected boolean termCompare(Term term)
Description copied from class:FilteredTermEnum
Equality compare on the term- Specified by:
termCompare
in classFilteredTermEnum
-
-