FileDocCategorySizeDatePackage
JakartaRegexpCapabilities.javaAPI DocApache Lucene 2.1.01912Wed Feb 14 10:46:32 GMT 2007org.apache.lucene.search.regex

JakartaRegexpCapabilities

public class JakartaRegexpCapabilities extends Object implements RegexCapabilities
Implementation tying Jakarta Regexp to RegexQuery. Thanks to some internals of Jakarta Regexp, this has a solid {@link #prefix} implementation.

Fields Summary
private org.apache.regexp.RE
regexp
Constructors Summary
Methods Summary
public voidcompile(java.lang.String pattern)

    regexp = new RE(pattern);
  
public booleanequals(java.lang.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 inthashCode()

    return (regexp != null ? regexp.hashCode() : 0);
  
public booleanmatch(java.lang.String string)

    return regexp.match(string);
  
public java.lang.Stringprefix()

    char[] prefix = RegexpTunnel.getPrefix(regexp);
    return prefix == null ? null : new String(prefix);