|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.search.AbstractCharSequenceSearchRequest
public abstract class AbstractCharSequenceSearchRequest
Field Summary | |
---|---|
static String |
PROPERTY_PAGES
page list property. |
Constructor Summary | |
---|---|
protected |
AbstractCharSequenceSearchRequest()
|
Method Summary | ||
---|---|---|
void |
addSearchStateListener(SearchStateListener listener)
Add a SearchStateListener to the AbstractCharSequenceSearchRequest to get
SearchStateChangeEvent s if the state of the request changed. |
|
void |
cancel()
cancel the current request |
|
protected abstract CharSequenceMatcher |
createMatcher()
Creates a CharSequenceMatcher . |
|
protected void |
ensureModifiable()
Utility method which will throw a IllegalStateException if isModifiable()
returns false |
|
protected void |
ensureNotRunning()
|
|
protected void |
ensureValid()
|
|
void |
execute()
|
|
void |
executeSync()
Executes this AbstractCharSequenceSearchRequest (or implementation) synchronous on the
current thread. |
|
|
getInternalHook(Class<T> clazz)
THIS IS A JADICE INTERNAL METHOD. Use is only for internal purposes. |
|
List<Page> |
getPages()
the Page s that have been specified using the setPages(List) method. |
|
EventList<Result> |
getResultList()
|
|
SearchRequest.SearchState |
getState()
|
|
boolean |
isModifiable()
Informs if the AbstractCharSequenceSearchRequest is modifiable or not. |
|
boolean |
isRunning()
checks if the AbstractCharSequenceSearchRequest is currently being processed by the
internal search engine. |
|
boolean |
isValid()
Checks if the configuration of the AbstractCharSequenceSearchRequest is sufficient. |
|
void |
reset()
Reset the current request. |
|
void |
setPages(List<Page> pages)
Specifies the Page s to search in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_PAGES
setPages(List)
,
Constant Field ValuesConstructor Detail |
---|
protected AbstractCharSequenceSearchRequest()
Method Detail |
---|
public final void addSearchStateListener(SearchStateListener listener)
SearchStateListener
to the AbstractCharSequenceSearchRequest
to get
SearchStateChangeEvent
s if the state of the request changed.
listener
- the SearchStateListener
to be addedpublic void cancel()
IllegalStateException
- if the AbstractCharSequenceSearchRequest
is not
running
public void reset()
IllegalStateException
- if the AbstractCharSequenceSearchRequest
is not
running
protected void ensureModifiable()
IllegalStateException
if isModifiable()
returns false
public void execute()
IllegalStateException
- if the search request is not properly initializedprotected void ensureNotRunning()
protected void ensureValid()
public void executeSync()
AbstractCharSequenceSearchRequest
(or implementation) synchronous on the
current thread. It will not have any influence on other searches running parallel.
IllegalStateException
- if the search request is not properly initializedpublic <T> T getInternalHook(Class<T> clazz)
public List<Page> getPages()
Page
s that have been specified using the setPages(List)
method.
Page
s that have been specified using setPages(List)
setPages(List)
public boolean isModifiable()
AbstractCharSequenceSearchRequest
is modifiable or not. A
AbstractCharSequenceSearchRequest
is modifiable as long it hasn't been executed using
the execute()
method. If the request has been executed any changes using methods like
setPages(List)
will result in a IllegalStateException
. Once the internal
search enginge completes its work or has been cancelled using the cancel()
method, the
AbstractCharSequenceSearchRequest
will become modifiable again.AbstractCharSequenceSearchRequest
will not be modifiable directly after a call to the
cancel()
method. The internal search engine will stop searching at a unspecified
moment after the cancel()
has been invoked.
public boolean isRunning()
AbstractCharSequenceSearchRequest
is currently being processed by the
internal search engine.
true
if this SearchRequest
is currently being processedpublic boolean isValid()
AbstractCharSequenceSearchRequest
is sufficient.
Whether or not a AbstractCharSequenceSearchRequest
is valid is up to the specific
implementation. AbstractCharSequenceSearchRequest
will check if pages have been
supplied.
true
if the configuration is sufficientpublic void setPages(List<Page> pages)
Page
s to search in. This method will create a copy of the shapshot of the
list of pages, so that later modifications to the list of pages have no effect.
NOTE:
Please keep in Mind that settings using this method will only be possible if the request is
modifiable. If the SearchRequest
is not modifiable this method will throw a
IllegalStateException
. For details about the modifiable state of the
AbstractCharSequenceSearchRequest
, please see isModifiable()
pages
- the pages to search for text in
IllegalArgumentException
- if pages
is null of has a size of zero
IllegalStateException
- if the search request is not modifiable (see
isModifiable()
protected abstract CharSequenceMatcher createMatcher()
CharSequenceMatcher
. This method may never return null.
CharSequenceMatcher
public EventList<Result> getResultList()
public SearchRequest.SearchState getState()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |