org.apache.lucene.search.regex

Interface RegexCapabilities

public interface RegexCapabilities

Defines basic operations needed by RegexQuery for a regular expression implementation.
Method Summary
voidcompile(String pattern)
Called by the constructor of RegexTermEnum allowing implementations to cache a compiled version of the regular expression pattern.
booleanmatch(String string)
Stringprefix()
A wise prefix implementation can reduce the term enumeration (and thus performance) of RegexQuery dramatically!

Method Detail

compile

public void compile(String pattern)
Called by the constructor of RegexTermEnum allowing implementations to cache a compiled version of the regular expression pattern.

Parameters: pattern regular expression pattern

match

public boolean match(String string)

Parameters: string

Returns: true if string matches the pattern last passed to RegexCapabilities.

prefix

public String prefix()
A wise prefix implementation can reduce the term enumeration (and thus performance) of RegexQuery dramatically!

Returns: static non-regex prefix of the pattern last passed to RegexCapabilities. May return null.

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.