org.apache.lucene.search.regex
Class JavaUtilRegexCapabilities
java.lang.Object
org.apache.lucene.search.regex.JavaUtilRegexCapabilities
- All Implemented Interfaces:
- org.apache.lucene.search.regex.RegexCapabilities
- public class JavaUtilRegexCapabilities
- extends java.lang.Object
- implements org.apache.lucene.search.regex.RegexCapabilities
An implementation tying Java's built-in java.util.regex to RegexQuery.
Note that because this implementation currently only returns null from
prefix() that queries using this implementation will enumerate and
attempt to match(java.lang.String) each term for the specified field in the index.
|
Method Summary |
void |
compile(java.lang.String pattern)
Called by the constructor of RegexTermEnum allowing
implementations to cache a compiled version of the regular
expression pattern. |
boolean |
equals(java.lang.Object o)
|
int |
hashCode()
|
boolean |
match(java.lang.String string)
|
java.lang.String |
prefix()
A wise prefix implementation can reduce the term enumeration (and thus performance)
of RegexQuery dramatically! |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
JavaUtilRegexCapabilities
public JavaUtilRegexCapabilities()
compile
public void compile(java.lang.String pattern)
- Description copied from interface:
org.apache.lucene.search.regex.RegexCapabilities
- Called by the constructor of
RegexTermEnum allowing
implementations to cache a compiled version of the regular
expression pattern.
- Specified by:
compile in interface org.apache.lucene.search.regex.RegexCapabilities
- Parameters:
pattern - regular expression pattern
match
public boolean match(java.lang.String string)
- Specified by:
match in interface org.apache.lucene.search.regex.RegexCapabilities
- Parameters:
string -
- Returns:
- true if string matches the pattern last passed to
RegexCapabilities.compile(java.lang.String).
prefix
public java.lang.String prefix()
- Description copied from interface:
org.apache.lucene.search.regex.RegexCapabilities
- A wise prefix implementation can reduce the term enumeration (and thus performance)
of RegexQuery dramatically!
- Specified by:
prefix in interface org.apache.lucene.search.regex.RegexCapabilities
- Returns:
- static non-regex prefix of the pattern last passed to
RegexCapabilities.compile(java.lang.String). May return null.
equals
public boolean equals(java.lang.Object o)
hashCode
public int hashCode()
Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.