java.lang.Object | |
↳ | com.urbanairship.CancelableOperation |
A cancelable operation that executes its task on a specific looper.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CancelableOperation()
CancelableOperation constructor.
| |||||||||||
CancelableOperation(Looper looper)
CancelableOperation constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CancelableOperation |
addOnCancel(Cancelable cancelable)
Adds a
Cancelable that will be called when operation is cancelled. | ||||||||||
CancelableOperation |
addOnRun(Runnable runnable)
Adds a runnable that will be called when operation is finished.
| ||||||||||
final boolean |
cancel()
Cancels the operation.
| ||||||||||
final boolean |
cancel(boolean mayInterruptIfRunning)
Cancels the operation.
| ||||||||||
Handler |
getHandler()
Gets the handler for the operation.
| ||||||||||
final boolean |
isCancelled()
Determines if the operation is canceled.
| ||||||||||
final boolean |
isDone()
Determines if the operation is canceled or completed.
| ||||||||||
final void | run() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
onCancel()
Called on the handlers callback when the operation is canceled.
| ||||||||||
void |
onRun()
Called on the handlers callback when the operation is running.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.urbanairship.Cancelable
| |||||||||||
From interface
java.lang.Runnable
|
CancelableOperation constructor.
CancelableOperation constructor.
looper | A Looper object whose message queue will be used for the callback, or null to make callbacks on the calling thread or main thread if the current thread does not have a looper associated with it. |
---|
Adds a Cancelable
that will be called when operation is cancelled. If the operation
is already canceled the operation will immediately be canceled.
cancelable | The instance that implements the Cancelable interface.
|
---|
Adds a runnable that will be called when operation is finished. If the operation is already finished the runnable will be called immediately.
runnable | A runnable. |
---|
Cancels the operation.
false
if the cancelable was able to be cancelled, otherwise true
.
Cancels the operation.
mayInterruptIfRunning | true if the thread executing this task should be interrupted; otherwise, in-progress tasks are allowed to complete. |
---|
false
if the cancelable was able to be cancelled, otherwise true
.
Determines if the operation is canceled.
true
if canceled, otherwise false
Determines if the operation is canceled or completed.
true
if canceled or completed, otherwise false
Called on the handlers callback when the operation is canceled.
Called on the handlers callback when the operation is running.