public abstract class NGram
extends de.ims.icarus.util.PropertyChangeSource
Modifier | Constructor and Description |
---|---|
protected |
NGram(NGramDescriptor descriptor) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Attempts to cancel this ngram by setting the internal
cancelled
flag to true . |
abstract void |
execute()
Runs the ngram and constructs the internal
NGramResult object. |
NGramDescriptor |
getDescriptor() |
abstract int |
getProgress()
Returns the (estimated) progress of the search in the range
0 to 100.
|
NGramQuery |
getQuery() |
abstract NGramResult |
getResult()
Returns the result of this search operation.
|
NGramState |
getState() |
boolean |
isCancelled() |
boolean |
isDone() |
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener
protected NGram(NGramDescriptor descriptor)
public final NGramState getState()
public final NGramDescriptor getDescriptor()
public final NGramQuery getQuery()
public final boolean isCancelled()
public final boolean isDone()
public final void cancel()
cancelled
flag to true
.
This method will throw an IllegalArgumentException
if the
ngram is not yet running or has already been finished or cancelled.public abstract void execute() throws java.lang.Exception
NGramResult
object.
Note that an implementation should regularly check for user originated
cancellation by invoking isCancelled()
.java.lang.Exception
public abstract int getProgress()
public abstract NGramResult getResult()
null
until the search has finished or an empty result.