|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.regex.JavaUtilRegexCapabilities
public class JavaUtilRegexCapabilities
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.
Field Summary | |
---|---|
static int |
FLAG_CANON_EQ
|
static int |
FLAG_CASE_INSENSITIVE
|
static int |
FLAG_COMMENTS
|
static int |
FLAG_DOTALL
|
static int |
FLAG_LITERAL
|
static int |
FLAG_MULTILINE
|
static int |
FLAG_UNICODE_CASE
|
static int |
FLAG_UNIX_LINES
|
Constructor Summary | |
---|---|
JavaUtilRegexCapabilities()
Default constructor that uses java.util.regex.Pattern with its default flags. |
|
JavaUtilRegexCapabilities(int flags)
Constructor that allows for the modification of the flags that the java.util.regex.Pattern will use to compile the regular expression. |
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 increase performance) of RegexQuery dramatically! |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FLAG_CANON_EQ
public static final int FLAG_CASE_INSENSITIVE
public static final int FLAG_COMMENTS
public static final int FLAG_DOTALL
public static final int FLAG_LITERAL
public static final int FLAG_MULTILINE
public static final int FLAG_UNICODE_CASE
public static final int FLAG_UNIX_LINES
Constructor Detail |
---|
public JavaUtilRegexCapabilities()
public JavaUtilRegexCapabilities(int flags)
Pattern
class supports specifying
these fields via the regular expression text itself, but this gives the caller
another option to modify the behavior. Useful in cases where the regular expression text
cannot be modified, or if doing so is undesired.
flags
- The flags that are ORed together.Method Detail |
---|
public void compile(String pattern)
RegexCapabilities
RegexTermEnum
allowing
implementations to cache a compiled version of the regular
expression pattern.
compile
in interface RegexCapabilities
pattern
- regular expression patternpublic boolean match(String string)
match
in interface RegexCapabilities
RegexCapabilities.compile(java.lang.String)
.public String prefix()
RegexCapabilities
prefix
in interface RegexCapabilities
RegexCapabilities.compile(java.lang.String)
. May return null.public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |