Interface PriorityTask

All Superinterfaces:
Comparable<PriorityTask>
All Known Implementing Classes:
PriorityCallable, PriorityRunnable

public interface PriorityTask extends Comparable<PriorityTask>
Represents a task such as Runnable or Comparable that adheres to a priority by implementing Comparable. Uses a combination of priority and index to compare between this and other PriorityTask instances. A calculator (e.g. CommandPriorityCalculator) defines the priority of the task. This task uses the index to differentiate between tasks with the same priority, ensuring the insert order is leading in those scenarios.
Since:
4.6.0
Author:
Stefan Dragisic, Milan Savic, Allard Buijze, Steven van Beelen, Mitchell Herrijgers
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
     
    long
    Returns the priority of this task.
    long
    Returns the sequence of this task.
  • Method Details

    • priority

      long priority()
      Returns the priority of this task.
      Returns:
      The priority of this task.
    • sequence

      long sequence()
      Returns the sequence of this task.
      Returns:
      The sequence of this task.
    • compareTo

      default int compareTo(PriorityTask that)
      Specified by:
      compareTo in interface Comparable<PriorityTask>