org.apache.lucene.search.regex
Class JakartaRegexpCapabilities

java.lang.Object
  extended byorg.apache.lucene.search.regex.JakartaRegexpCapabilities
All Implemented Interfaces:
org.apache.lucene.search.regex.RegexCapabilities

public class JakartaRegexpCapabilities
extends Object
implements org.apache.lucene.search.regex.RegexCapabilities

Implementation tying Jakarta Regexp to RegexQuery. Thanks to some internals of Jakarta Regexp, this has a solid prefix() implementation.


Constructor Summary
JakartaRegexpCapabilities()
           
 
Method Summary
 void compile(String pattern)
          Called by the constructor of RegexTermEnum allowing implementations to cache a compiled version of the regular expression pattern.
 boolean equals(Object o)
           
 int hashCode()
           
 boolean match(String string)
           
 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
 

Constructor Detail

JakartaRegexpCapabilities

public JakartaRegexpCapabilities()
Method Detail

compile

public void compile(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(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 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(Object o)

hashCode

public int hashCode()


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