public abstract class Search extends de.ims.icarus.util.PropertyChangeSource implements SearchParameters
Modifier and Type | Class and Description |
---|---|
static interface |
Search.SearchPerformanceInfo |
Modifier and Type | Field and Description |
---|---|
protected long |
beginTimestamp |
protected long |
endTimestamp |
DEFAULT_OPTIMIZE_SEARCH, DEFAULT_SEARCH_CASESENSITIVE, DEFAULT_SEARCH_MAX_LENGTH, DEFAULT_SEARCH_MIN_LENGTH, DEFAULT_SEARCH_MODE, DEFAULT_SEARCH_NON_PROJECTIVE, DEFAULT_SEARCH_ORIENTATION, DEFAULT_SEARCH_RESULT_LIMIT, OPTIMIZE_SEARCH, SEARCH_CASESENSITIVE, SEARCH_MAX_LENGTH, SEARCH_MIN_LENGTH, SEARCH_MODE, SEARCH_NON_PROJECTIVE, SEARCH_ORIENTATION, SEARCH_RESULT_LIMIT
Modifier | Constructor and Description |
---|---|
protected |
Search(SearchFactory factory,
SearchQuery query,
de.ims.icarus.util.Options parameters,
java.lang.Object target) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Attempts to cancel this search by setting the internal
cancelled
flag to true . |
void |
execute()
Runs the search and constructs the internal
SearchResult object. |
void |
finish() |
SearchFactory |
getFactory() |
java.lang.Object |
getParameter(java.lang.String key) |
de.ims.icarus.util.Options |
getParameters() |
abstract Search.SearchPerformanceInfo |
getPerformanceInfo() |
int |
getProgress()
Returns the (estimated) progress of the search in the range
0 to 100.
|
java.lang.Object |
getProperty(java.lang.String key) |
SearchQuery |
getQuery() |
abstract SearchResult |
getResult()
Returns the result of this search operation.
|
abstract SearchResolver |
getSearchResolver() |
SearchState |
getState() |
java.lang.Object |
getTarget() |
boolean |
init() |
protected void |
innerCancel()
Callback for subclasses to perform proper cleanup of their
resources
|
protected abstract boolean |
innerExecute()
Performs the implementation specific scheduling of
the search operation.
|
boolean |
isCancelled() |
boolean |
isDone() |
boolean |
isRunning() |
boolean |
isSerializable() |
protected void |
setProgress(int newProgress) |
void |
setProperty(java.lang.String key,
java.lang.Object value) |
protected void |
setState(SearchState state) |
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
protected Search(SearchFactory factory, SearchQuery query, de.ims.icarus.util.Options parameters, java.lang.Object target)
public boolean isSerializable()
public abstract SearchResolver getSearchResolver()
public boolean init()
protected final void setState(SearchState state)
public final SearchState getState()
public final SearchFactory getFactory()
public final SearchQuery getQuery()
public final java.lang.Object getTarget()
public final java.lang.Object getProperty(java.lang.String key)
public final void setProperty(java.lang.String key, java.lang.Object value)
public final java.lang.Object getParameter(java.lang.String key)
public de.ims.icarus.util.Options getParameters()
public final boolean isCancelled()
public final boolean isDone()
public final boolean isRunning()
public final void cancel()
cancelled
flag to true
.
This method will throw an IllegalArgumentException
if the
search is not yet running or has already been finished or cancelled.protected void innerCancel()
public final void finish()
public final void execute() throws java.lang.Exception
SearchResult
object.
Note that an implementation should regularly check for user originated
cancellation by invoking isCancelled()
.java.lang.Exception
protected abstract boolean innerExecute() throws java.lang.Exception
false
to signal an early exit. The search
will then set its state to .true
if and only if the search operation
was successfully scheduled.java.lang.Exception
public int getProgress()
protected void setProgress(int newProgress)
public abstract SearchResult getResult()
null
until the search has finished or an empty result.public abstract Search.SearchPerformanceInfo getPerformanceInfo()