Package com.jackdaw.chatwithnpc
Class AsyncTask
java.lang.Object
com.jackdaw.chatwithnpc.AsyncTask
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Task result that does need to continue.static interface
Task interfacestatic interface
Task result interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
call
(@NotNull AsyncTask.Task task) Call the task asynchronously.static boolean
Check if the task queue is empty.static @NotNull AsyncTask.TaskResult
Create a task result that does need to continue.static AsyncTask.TaskResult
Poll 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.
-