Class Task

  • All Implemented Interfaces:
    java.lang.Comparable<Task>

    public abstract class Task
    extends java.lang.Object
    implements java.lang.Comparable<Task>
    • Constructor Detail

      • Task

        public Task()
    • Method Detail

      • validate

        public abstract boolean validate()
        Returns:
        true if this Task should run, false otherwise
      • execute

        public abstract int execute()
        The code to execute if this Task validates
      • isBlocking

        public boolean isBlocking()
        The default behaviour of this method is to return true
        Returns:
        true if the task loop should break after executing this Task, 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 class java.lang.Object
      • compareTo

        public final int compareTo​(Task o)
        Specified by:
        compareTo in interface java.lang.Comparable<Task>