org.apache.lucene.search

Class 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.

Version: $Id: WildcardTermEnum.java 329859 2005-10-31 17:05:36Z bmesser $

Field Summary
static charWILDCARD_CHAR
static charWILDCARD_STRING
String equality with support for wildcards
Constructor Summary
WildcardTermEnum(IndexReader reader, Term term)
Creates a new WildcardTermEnum.
Method Summary
voidclose()
floatdifference()
booleanendEnum()
protected booleantermCompare(Term term)
static booleanwildcardEquals(String pattern, int patternIdx, String string, int stringIdx)
Determines if a word matches a wildcard pattern.

Field Detail

WILDCARD_CHAR

public static final char WILDCARD_CHAR

WILDCARD_STRING

public static final char WILDCARD_STRING
String equality with support for wildcards

Constructor Detail

WildcardTermEnum

public WildcardTermEnum(IndexReader reader, Term term)
Creates a new WildcardTermEnum. Passing in a {@link org.apache.lucene.index.Term Term} that does not contain a WILDCARD_CHAR will 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.

Method Detail

close

public void close()

difference

public final float difference()

endEnum

public final boolean endEnum()

termCompare

protected final boolean termCompare(Term term)

wildcardEquals

public static final boolean wildcardEquals(String pattern, int patternIdx, 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.
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.