Enum Class Priority

java.lang.Object
java.lang.Enum<Priority>
ca.spottedleaf.concurrentutil.util.Priority
All Implemented Interfaces:
Serializable, Comparable<Priority>, Constable

public enum Priority extends Enum<Priority>
  • Enum Constant Details

    • COMPLETING

      public static final Priority COMPLETING
      Priority value indicating the task has completed or is being completed. This priority cannot be used to schedule tasks.
    • BLOCKING

      public static final Priority BLOCKING
      Absolute highest priority, should only be used for when a task is blocking a time-critical thread.
    • HIGHEST

      public static final Priority HIGHEST
      Should only be used for urgent but not time-critical tasks.
    • HIGHER

      public static final Priority HIGHER
      Two priorities above normal.
    • HIGH

      public static final Priority HIGH
      One priority above normal.
    • NORMAL

      public static final Priority NORMAL
      Default priority.
    • LOW

      public static final Priority LOW
      One priority below normal.
    • LOWER

      public static final Priority LOWER
      Two priorities below normal.
    • LOWEST

      public static final Priority LOWEST
      Use for tasks that should eventually execute, but are not needed to.
    • IDLE

      public static final Priority IDLE
      Use for tasks that can be delayed indefinitely.
  • Field Details

    • TOTAL_PRIORITIES

      public static final int TOTAL_PRIORITIES
      includes special priorities
    • TOTAL_SCHEDULABLE_PRIORITIES

      public static final int TOTAL_SCHEDULABLE_PRIORITIES
    • priority

      public final int priority
  • Method Details

    • values

      public static Priority[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Priority valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isValidPriority

      public static boolean isValidPriority(Priority priority)
    • max

      public static Priority max(Priority p1, Priority p2)
    • min

      public static Priority min(Priority p1, Priority p2)
    • isHigherOrEqualPriority

      public boolean isHigherOrEqualPriority(Priority than)
    • isHigherPriority

      public boolean isHigherPriority(Priority than)
    • isLowerOrEqualPriority

      public boolean isLowerOrEqualPriority(Priority than)
    • isLowerPriority

      public boolean isLowerPriority(Priority than)
    • isHigherOrEqualPriority

      public boolean isHigherOrEqualPriority(int than)
    • isHigherPriority

      public boolean isHigherPriority(int than)
    • isLowerOrEqualPriority

      public boolean isLowerOrEqualPriority(int than)
    • isLowerPriority

      public boolean isLowerPriority(int than)
    • isHigherOrEqualPriority

      public static boolean isHigherOrEqualPriority(int priority, int than)
    • isHigherPriority

      public static boolean isHigherPriority(int priority, int than)
    • isLowerOrEqualPriority

      public static boolean isLowerOrEqualPriority(int priority, int than)
    • isLowerPriority

      public static boolean isLowerPriority(int priority, int than)
    • getPriority

      public static Priority getPriority(int priority)