R - The Result Typepublic class Task<R> extends Object
| 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> |
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> |
onSuccess(OnSuccess<R> onSuccess)
Callback executed when the Task result is ready
|
Task<R> |
setPriority(int priority)
Sets the priority
|
public int getPriority()
@NotNull public Task<R> setPriority(int priority)
priority - The new Priority@NotNull public Task<R> executeAsync()
public boolean cancel()
@NotNull public Task<R> await() throws RuntimeThreadException
RuntimeThreadException@Nullable public R getResult() throws RuntimeThreadException
RuntimeThreadException - The probable Exception throw by the ThreadCopyright © 2016. All rights reserved.