|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.search.AbstractCharSequenceSearchRequest com.levigo.jadice.search.PatternSearchRequest
public class PatternSearchRequest
A variation of a AbstractCharSequenceSearchRequest
which allows
searching using Pattern
s. This kind of
search request
is mainly useful for
batch processing of documents. A array of patterns has to be set using the
setPatterns(Pattern[])
method. Each one will be executed, in the
indexing order of the array.
The PatternSearchRequest
will provide the matching pattern as the
handback value of Result
. Please see Result.getHandback()
and
MatchConsumer.match(int, int, Object)
for details.
Nested Class Summary | |
---|---|
protected static class |
PatternSearchRequest.PatternMatcher
|
Field Summary |
---|
Fields inherited from class com.levigo.jadice.search.AbstractCharSequenceSearchRequest |
---|
PROPERTY_PAGES |
Constructor Summary | |
---|---|
PatternSearchRequest()
|
Method Summary | |
---|---|
protected CharSequenceMatcher |
createMatcher()
Creates a CharSequenceMatcher . |
Pattern[] |
getPatterns()
Returns the Pattern s applied to this PatternSearchRequest
or null if no patterns have been applied yet. |
boolean |
isValid()
Extends the AbstractCharSequenceSearchRequest.isValid() by
requiring a valid array of Pattern s. |
void |
setPatterns(Pattern[] patterns)
Assign an array of Patterns to this PatternSearchRequest . |
Methods inherited from class com.levigo.jadice.search.AbstractCharSequenceSearchRequest |
---|
addSearchStateListener, cancel, ensureModifiable, ensureNotRunning, ensureValid, execute, executeSync, getInternalHook, getPages, getResultList, getState, isModifiable, isRunning, reset, setPages |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PatternSearchRequest()
Method Detail |
---|
public void setPatterns(Pattern[] patterns)
PatternSearchRequest
. The array must not be null,
have a zero length and no element in the array may be null
. Is one of the
conditions, mentioned before, violated this method will throw an
IllegalArgumentException
.
patterns
- the Pattern
s to search for.
IllegalArgumentException
- if the array is null or has zero length.public Pattern[] getPatterns()
Pattern
s applied to this PatternSearchRequest
or null
if no patterns have been applied yet.
Pattern
s applied to this PatternSearchRequest
or null
if no patterns have been applied yet.public boolean isValid()
AbstractCharSequenceSearchRequest.isValid()
by
requiring a valid array of Pattern
s. Please see
AbstractCharSequenceSearchRequest.isValid()
for details.
isValid
in class AbstractCharSequenceSearchRequest
true
if the configuration is sufficientAbstractCharSequenceSearchRequest.isValid()
protected CharSequenceMatcher createMatcher()
AbstractCharSequenceSearchRequest
CharSequenceMatcher
. This method may never return null.
createMatcher
in class AbstractCharSequenceSearchRequest
CharSequenceMatcher
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |