org.apache.lucene.search
Class WildcardTermEnum
- java.lang.Object
-
- org.apache.lucene.index.TermEnum
-
- org.apache.lucene.search.FilteredTermEnum
-
- org.apache.lucene.search.WildcardTermEnum
-
public class WildcardTermEnum extends FilteredTermEnum
Subclass of FilteredTermEnum for enumerating all terms that match the specified wildcard filter term.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 and Description static charWILDCARD_CHARstatic charWILDCARD_STRINGString equality with support for wildcards
-
Constructor Summary
Constructors Constructor and Description WildcardTermEnum(IndexReader reader, Term term)Creates a newWildcardTermEnum.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Closes the enumeration to further activity, freeing resources.floatdifference()Equality measure on the termbooleanendEnum()Indicates the end of the enumeration has been reachedstatic booleanwildcardEquals(java.lang.String pattern, int patternIdx, java.lang.String string, int stringIdx)Determines if a word matches a wildcard pattern.-
Methods inherited from class org.apache.lucene.search.FilteredTermEnum
docFreq, next, term
-
-
-
-
Field Detail
-
WILDCARD_STRING
public static final char WILDCARD_STRING
String equality with support for wildcards- See Also:
- Constant Field Values
-
WILDCARD_CHAR
public static final char WILDCARD_CHAR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WildcardTermEnum
public WildcardTermEnum(IndexReader reader, Term term) throws java.io.IOException
Creates a newWildcardTermEnum. Passing in aTermthat does not contain aWILDCARD_CHARwill cause an exception to be thrown.After calling the constructor the enumeration is already pointing to the first valid term if such a term exists.
- Throws:
java.io.IOException
-
-
Method Detail
-
difference
public final float difference()
Description copied from class:FilteredTermEnumEquality measure on the term- Specified by:
differencein classFilteredTermEnum
-
endEnum
public final boolean endEnum()
Description copied from class:FilteredTermEnumIndicates the end of the enumeration has been reached
-
wildcardEquals
public static final boolean wildcardEquals(java.lang.String pattern, int patternIdx, java.lang.String string, int stringIdx)Determines if a word matches a wildcard pattern. Work released by Granta Design Ltd after originally being done on company time.
-
close
public void close() throws java.io.IOExceptionDescription copied from class:FilteredTermEnumCloses the enumeration to further activity, freeing resources.- Overrides:
closein classFilteredTermEnum- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG