Package org.praxislive.ide.core.api
Class AbstractTask.WithResult<T>
java.lang.Object
org.praxislive.ide.core.api.AbstractTask
org.praxislive.ide.core.api.AbstractTask.WithResult<T>
- Type Parameters:
T- result type
- All Implemented Interfaces:
org.openide.util.Cancellable,Task,Task.WithResult<T>
- Enclosing class:
AbstractTask
public abstract static class AbstractTask.WithResult<T>
extends AbstractTask
implements Task.WithResult<T>
A base implementation of a task with a result. Extensions of this class
should make sure to call
complete(java.lang.Object) to set the
result and complete the task if successful.-
Nested Class Summary
Nested classes/interfaces inherited from class org.praxislive.ide.core.api.AbstractTask
AbstractTask.WithResult<T>Nested classes/interfaces inherited from interface org.praxislive.ide.core.api.Task
Task.State, Task.WithResult<T> -
Field Summary
Fields inherited from interface org.praxislive.ide.core.api.Task
PROP_STATE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.praxislive.ide.core.api.AbstractTask
addPropertyChangeListener, cancel, execute, getState, handleCancel, handleExecute, removePropertyChangeListener, updateStateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openide.util.Cancellable
cancelMethods inherited from interface org.praxislive.ide.core.api.Task
addPropertyChangeListener, description, execute, getState, log, removePropertyChangeListener
-
Constructor Details
-
WithResult
public WithResult()
-
-
Method Details
-
result
Description copied from interface:Task.WithResultAccess the result. This method should only be called when the task is in a completed state. The result in other states is undefined.- Specified by:
resultin interfaceTask.WithResult<T>- Returns:
- completed task result
-
complete
Complete the task with the given result. The task must be inTask.State.RUNNING. The result will be set and the task put intoTask.State.COMPLETEDwith all listeners called.- Parameters:
result- result to complete task
-