public abstract class AbstractCharSequenceSearchRequest extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_PAGES
page list property.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractCharSequenceSearchRequest() |
Modifier and Type | Method and Description |
---|---|
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()
|
protected void |
ensureNotRunning() |
protected void |
ensureValid() |
void |
execute() |
void |
executeSync()
Executes this
AbstractCharSequenceSearchRequest (or implementation) synchronous on the
current thread. |
<T> T |
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 |
removeSearchStateListener(SearchStateListener listener)
Deregister a
SearchStateListener |
void |
reset()
Reset the current request.
|
void |
setPages(List<Page> pages)
Specifies the
Page s to search in. |
public static final String PROPERTY_PAGES
setPages(List)
,
Constant Field Valuespublic 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 final void removeSearchStateListener(SearchStateListener listener)
SearchStateListener
listener
- the listener to removepublic void cancel()
IllegalStateException
- if the AbstractCharSequenceSearchRequest
is not
running
public void reset()
IllegalStateException
- if the AbstractCharSequenceSearchRequest
is not
running
protected void ensureModifiable()
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 inIllegalArgumentException
- if pages
is null of has a size of zeroIllegalStateException
- if the search request is not modifiable (see
isModifiable()
protected abstract CharSequenceMatcher createMatcher()
CharSequenceMatcher
. This method may never return null.CharSequenceMatcher
public SearchRequest.SearchState getState()
Copyright © 2024 levigo holding gmbh. All rights reserved.