Package rs.kreme.ksbot.api.scripts.task
Class Task
- java.lang.Object
-
- rs.kreme.ksbot.api.scripts.task.Task
-
-
Constructor Summary
Constructors Constructor Description Task()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(Task o)
abstract int
execute()
The code to execute if thisTask
validatesint
getPriority()
boolean
isBlocking()
The default behaviour of this method is to returntrue
java.lang.String
toString()
abstract boolean
validate()
-
-
-
Method Detail
-
validate
public abstract boolean validate()
- Returns:
true
if thisTask
should run,false
otherwise
-
execute
public abstract int execute()
The code to execute if thisTask
validates
-
isBlocking
public boolean isBlocking()
The default behaviour of this method is to returntrue
- Returns:
true
if the task loop should break after executing thisTask
,false
if it should continue and execute other tasks that validate in the same loop
-
getPriority
public int getPriority()
- Returns:
- The priority of this Task. A lower priority denotes prioritized
execution. The default return of this method is
Integer.MAX_VALUE
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-