Class Task
java.lang.Object
net.lucypoulton.squirtgun.platform.scheduler.Task
A task that can be run. It can be scheduled to run later, or to repeat itself, and it may be asynchronous.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Task.Builderbuilder()static Task.Builderstatic Task.BuilderbooleanvoidExecutes this task.intgetDelay()How long to wait before executing this task.longgetId()Get the numeric ID assigned to this task.intHow many ticks to wait between executing repeatedly, or -1 if it should not repeat.inthashCode()booleanisAsync()Whether this task should be run asynchronously.booleanWhether this task is repeating.toString()
-
Method Details
-
builder
-
builder
-
builder
-
isRepeating
public boolean isRepeating()Whether this task is repeating. -
getDelay
public int getDelay()How long to wait before executing this task. -
getInterval
public int getInterval()How many ticks to wait between executing repeatedly, or -1 if it should not repeat. -
execute
Executes this task. -
isAsync
public boolean isAsync()Whether this task should be run asynchronously. -
getId
public long getId()Get the numeric ID assigned to this task.Task IDs are auto-incremental and unique.
- Returns:
- the task ID
-
toString
-
equals
-
hashCode
public int hashCode()
-