| Constructor and Description |
|---|
Task(Callable<R> callable)
Creates a new Task
|
| Modifier and Type | Method and Description |
|---|---|
Task<R> |
await()
Ensures that the result is ready to be returned
|
boolean |
cancel()
Cancel the Task
|
Task<R> |
execute(ExecutionMode executionMode)
Executes the Task in the selected mode
|
Task<R> |
executeAsync()
Executes the Task Asynchronous
|
Task<R> |
executeSync()
Executes the Task Synchronous
|
int |
getPriority()
Gets the priority of the Task
|
R |
getResult()
Gets the result of the Task
|
Task<R> |
onException(OnException onException)
Callback executed when the Task ends with an exception
|
Task<R> |
onSuccess(OnSuccess<R> onSuccess)
Callback executed when the Task result is ready
|
Task<R> |
setPriority(int priority)
Sets the priority
|
public int getPriority()
getPriority in interface ITask<R>@NotNull public Task<R> setPriority(int priority)
setPriority in interface ITask<R>priority - The new Prioritypublic Task<R> execute(@NotNull ExecutionMode executionMode)
@NotNull public Task<R> executeAsync()
executeAsync in interface ITask<R>@NotNull public Task<R> executeSync()
executeSync in interface ITask<R>public boolean cancel()
@NotNull public Task<R> await() throws RuntimeThreadException
await in interface ITask<R>RuntimeThreadException@Nullable public R getResult() throws RuntimeThreadException
getResult in interface IDeferred<R>RuntimeThreadException - The probable Exception throw by the Thread@NotNull public Task<R> onSuccess(@Nullable OnSuccess<R> onSuccess)
@NotNull public Task<R> onException(@Nullable OnException onException)
onException in interface IPromise<R>onException - The Callback InterfaceCopyright © 2017. All rights reserved.