org.apache.lucene.search.regex
public class: JakartaRegexpCapabilities [javadoc |
source]
java.lang.Object
org.apache.lucene.search.regex.JakartaRegexpCapabilities
All Implemented Interfaces:
RegexCapabilities
Implementation tying
Jakarta Regexp
to RegexQuery. Thanks to some internals of Jakarta Regexp, this
has a solid
#prefix implementation.
| Field Summary |
|---|
| public static final int | FLAG_MATCH_NORMAL | Flag to specify normal, case-sensitive matching behaviour. This is the default. |
| public static final int | FLAG_MATCH_CASEINDEPENDENT | Flag to specify that matching should be case-independent (folded) |
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.lucene.search.regex.JakartaRegexpCapabilities Detail: |
public void compile(String pattern) {
regexp = new RE(pattern, this.flags);
}
|
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final JakartaRegexpCapabilities that = (JakartaRegexpCapabilities) o;
if (regexp != null ? !regexp.equals(that.regexp) : that.regexp != null) return false;
return true;
}
|
public int hashCode() {
return (regexp != null ? regexp.hashCode() : 0);
}
|
public boolean match(String string) {
return regexp.match(string);
}
|
public String prefix() {
char[] prefix = RegexpTunnel.getPrefix(regexp);
return prefix == null ? null : new String(prefix);
}
|