Package com.jackdaw.chatwithnpc
Class AsyncTask
java.lang.Object
com.jackdaw.chatwithnpc.AsyncTask
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTask result that does need to continue.static interfaceTask interfacestatic interfaceTask result interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcall(@NotNull AsyncTask.Task task) Call the task asynchronously.static booleanCheck if the task queue is empty.static @NotNull AsyncTask.TaskResultCreate a task result that does need to continue.static AsyncTask.TaskResultPoll the task queue.
-
Field Details
-
taskQueue
-
-
Constructor Details
-
AsyncTask
public AsyncTask()
-
-
Method Details
-
call
Call the task asynchronously. Then call the result in main thread if it is callable.- Parameters:
task- The task to call.
-
isTaskQueueEmpty
public static boolean isTaskQueueEmpty()Check if the task queue is empty.- Returns:
- True if the task queue is empty.
-
pollTaskQueue
Poll the task queue.- Returns:
- The task result.
-
nothingToDo
@Contract(value=" -> new", pure=true) @NotNull public static @NotNull AsyncTask.TaskResult nothingToDo()Create a task result that does need to continue.- Returns:
- The task that does nothing.
-