| Known Direct Subclasses |
A controllable Task that has a synchronized state machine.
| interface | StorageTask.ProvideError | An object that returns an exception. | |
| class | StorageTask.SnapshotBase | Base class for state. | |
| protected final Object | mSyncObject |
| StorageTask<TResult> |
addOnCanceledListener(OnCanceledListener listener)
Adds a listener that is called if the Task is canceled.
|
| StorageTask<TResult> |
addOnCanceledListener(Executor executor, OnCanceledListener listener)
Adds a listener that is called if the Task is canceled.
|
| StorageTask<TResult> |
addOnCanceledListener(Activity activity, OnCanceledListener listener)
Adds an Activity-scoped listener that is called if the Task is canceled.
|
| StorageTask<TResult> |
addOnCompleteListener(OnCompleteListener<TResult> listener)
Adds a listener that is called when the Task succeeds or fails.
|
| StorageTask<TResult> |
addOnCompleteListener(Activity activity, OnCompleteListener<TResult> listener)
Adds a listener that is called when the Task succeeds or fails.
|
| StorageTask<TResult> |
addOnCompleteListener(Executor executor, OnCompleteListener<TResult> listener)
Adds a listener that is called when the Task succeeds or fails.
|
| StorageTask<TResult> |
addOnFailureListener(Activity activity, OnFailureListener listener)
Adds a listener that is called if the Task fails.
|
| StorageTask<TResult> | |
| StorageTask<TResult> |
addOnFailureListener(Executor executor, OnFailureListener listener)
Adds a listener that is called if the Task fails.
|
| StorageTask<TResult> |
addOnPausedListener(Executor executor, OnPausedListener<? super TResult> listener)
Adds a listener that is called when the Task becomes paused.
|
| StorageTask<TResult> |
addOnPausedListener(Activity activity, OnPausedListener<? super TResult> listener)
Adds a listener that is called when the Task becomes paused.
|
| StorageTask<TResult> |
addOnPausedListener(OnPausedListener<? super TResult> listener)
Adds a listener that is called when the Task becomes paused.
|
| StorageTask<TResult> |
addOnProgressListener(Executor executor, OnProgressListener<? super TResult> listener)
Adds a listener that is called periodically while the ControllableTask executes.
|
| StorageTask<TResult> |
addOnProgressListener(OnProgressListener<? super TResult> listener)
Adds a listener that is called periodically while the ControllableTask executes.
|
| StorageTask<TResult> |
addOnProgressListener(Activity activity, OnProgressListener<? super TResult> listener)
Adds a listener that is called periodically while the ControllableTask executes.
|
| StorageTask<TResult> |
addOnSuccessListener(OnSuccessListener<? super TResult> listener)
Adds a listener that is called if the Task completes successfully.
|
| StorageTask<TResult> |
addOnSuccessListener(Activity activity, OnSuccessListener<? super TResult> listener)
Adds a listener that is called if the Task completes successfully.
|
| StorageTask<TResult> |
addOnSuccessListener(Executor executor, OnSuccessListener<? super TResult> listener)
Adds a listener that is called if the Task completes successfully.
|
| boolean |
cancel()
Attempts to cancel the task.
|
| <TContinuationResult> Task<TContinuationResult> |
continueWith(Continuation<TResult, TContinuationResult> continuation)
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
|
| <TContinuationResult> Task<TContinuationResult> |
continueWith(Executor executor, Continuation<TResult, TContinuationResult> continuation)
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
|
| <TContinuationResult> Task<TContinuationResult> |
continueWithTask(Executor executor, Continuation<TResult, Task<TContinuationResult>> continuation)
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
|
| <TContinuationResult> Task<TContinuationResult> |
continueWithTask(Continuation<TResult, Task<TContinuationResult>> continuation)
Returns a new Task that will be completed with the result of applying the specified
Continuation to this Task.
|
| Exception |
getException()
Returns the exception that caused the Task to fail.
|
| TResult |
getResult()
Gets the result of the Task, if it has already completed.
|
| <X extends Throwable> TResult | |
| TResult |
getSnapshot()
Returns the current state of the task.
|
| boolean |
isCanceled()
Returns
true if the task has been canceled. |
| boolean |
isComplete()
Returns
true if the Task is complete; false otherwise. |
| boolean |
isInProgress()
Returns
true if the task is currently running. |
| boolean |
isPaused()
Returns
true if the task has been paused. |
| boolean |
isSuccessful()
Returns
true if the Task has completed successfully; false otherwise. |
| <TContinuationResult> Task<TContinuationResult> |
onSuccessTask(Executor executor, SuccessContinuation<TResult, TContinuationResult> continuation)
Returns a new Task that will be completed with the result of applying the specified
SuccessContinuation to this Task when this Task completes successfully.
|
| <TContinuationResult> Task<TContinuationResult> |
onSuccessTask(SuccessContinuation<TResult, TContinuationResult> continuation)
Returns a new Task that will be completed with the result of applying the specified
SuccessContinuation to this Task when this Task completes successfully.
|
| boolean |
pause()
Attempts to pause the task.
|
| StorageTask<TResult> | |
| StorageTask<TResult> | |
| StorageTask<TResult> | |
| StorageTask<TResult> | |
| StorageTask<TResult> | |
| StorageTask<TResult> | |
| boolean |
resume()
Attempts to resume a paused task.
|
| void | |
| void | |
| void |
onPaused()
|
| void | |
| void |
onQueued()
|
| void |
Adds a listener that is called if the Task is canceled.
The listener will be called on main application thread. If the Task has already been canceled, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| listener |
|---|
Adds a listener that is called if the Task is canceled.
If the Task has already been canceled, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| executor | the executor to use to call the listener |
|---|---|
| listener |
Adds an Activity-scoped listener that is called if the Task is canceled.
The listener will be called on main application thread. If the Task has already been canceled, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
The listener will be automatically removed during onStop().
| activity | |
|---|---|
| listener |
Adds a listener that is called when the Task succeeds or fails.
The listener will be called on main application thread. If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| listener |
|---|
Adds a listener that is called when the Task succeeds or fails.
If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| activity | When the supplied Activity stops, this listener will automatically be
removed. |
|---|---|
| listener |
Adds a listener that is called when the Task succeeds or fails.
If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| executor | the executor to use to call the listener |
|---|---|
| listener |
Adds a listener that is called if the Task fails.
If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| activity | When the supplied Activity stops, this listener will automatically be
removed. |
|---|---|
| listener |
Adds a listener that is called if the Task fails.
The listener will be called on main application thread. If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| listener |
|---|
Adds a listener that is called if the Task fails.
If the task has already failed, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| executor | the executor to use to call the listener |
|---|---|
| listener |
Adds a listener that is called when the Task becomes paused.
| executor | the executor to use to call the listener |
|---|---|
| listener |
Adds a listener that is called when the Task becomes paused.
| activity | When the supplied Activity stops, this listener will automatically be
removed. |
|---|---|
| listener |
Adds a listener that is called when the Task becomes paused.
| listener |
|---|
Adds a listener that is called periodically while the ControllableTask executes.
| executor | the executor to use to call the listener |
|---|---|
| listener |
Adds a listener that is called periodically while the ControllableTask executes.
| listener |
|---|
Adds a listener that is called periodically while the ControllableTask executes.
| activity | When the supplied Activity stops, this listener will automatically be
removed. |
|---|---|
| listener |
Adds a listener that is called if the Task completes successfully. The listener will be called on the main application thread. If the task has already completed successfully, a call to the listener will be immediately scheduled. If multiple listeners are added, they will be called in the order in which they were added.
| listener |
|---|
Adds a listener that is called if the Task completes successfully.
If multiple listeners are added, they will be called in the order in which they were added. If the task has already completed successfully, a call to the listener will be immediately scheduled.
| activity | When the supplied Activity stops, this listener will automatically be
removed. |
|---|---|
| listener |
Adds a listener that is called if the Task completes successfully.
If multiple listeners are added, they will be called in the order in which they were added. If the task has already completed successfully, a call to the listener will be immediately scheduled.
| executor | the executor to use to call the listener |
|---|---|
| listener |
Attempts to cancel the task. A canceled task cannot be resumed later.
true if this task is successfully being canceled.
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
The Continuation will be called on the main application thread.
| continuation |
|---|
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
| executor | the executor to use to call the Continuation |
|---|---|
| continuation |
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
| executor | the executor to use to call the Continuation |
|---|---|
| continuation |
Returns a new Task that will be completed with the result of applying the specified Continuation to this Task.
The Continuation will be called on the main application thread.
| continuation |
|---|
Returns the exception that caused the Task to fail. Returns null if the Task is not yet
complete, or completed successfully.
Gets the result of the Task, if it has already completed.
| IllegalStateException | if the Task is not yet complete |
|---|---|
| RuntimeExecutionException | if the Task failed with an exception |
Gets the result of the Task, if it has already completed.
| exceptionType |
|---|
| IllegalStateException | if the Task is not yet complete |
|---|---|
| if the Task failed with an exception of type X | |
| RuntimeExecutionException | if the Task failed with an exception that was not of type X |
| Throwable |
Returns the current state of the task. This method will return state at any point of the tasks execution and may not be the final result..
Returns true if the task has been canceled.
Returns true if the Task is complete; false otherwise.
Returns true if the task is currently running.
Returns true if the task has been paused.
Returns true if the Task has completed successfully; false otherwise.
Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully. If the previous Task fails, the onSuccessTask completion will be skipped and failure listeners will be invoked.
If the previous Task is canceled, the returned Task will also be canceled and the SuccessContinuation would not execute.
| executor | the executor to use to call the SuccessContinuation |
|---|---|
| continuation |
Returns a new Task that will be completed with the result of applying the specified SuccessContinuation to this Task when this Task completes successfully. If the previous Task fails, the onSuccessTask completion will be skipped and failure listeners will be invoked.
The SuccessContinuation will be called on the main application thread.
If the previous Task is canceled, the returned Task will also be canceled and the SuccessContinuation would not execute.
| continuation |
|---|
Attempts to pause the task. A paused task can later be resumed.
true if this task is successfully being paused. Note that a task may not be
immediately paused if it was executing another action and can still fail or complete.
Removes a listener.
| listener |
|---|
Removes a listener.
| listener |
|---|
Removes a listener.
| listener |
|---|
Removes a listener.
| listener |
|---|
Removes a listener.
| listener |
|---|
Removes a listener.
| listener |
|---|
Attempts to resume a paused task.
true if the task is successfully resumed. false if the task has an
unrecoverable error or has entered another state that precludes resume.