All Superinterfaces:
Cloneable
All Known Implementing Classes:
PriorityImpl

public interface IPriority extends Cloneable
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the priority value adjusted to a rage from 0..n.
    addBonus(int bonus)
    Returns the value of this priority plus the given bonus.
    Creates a copy of this priority instance.
    Returns the current priority decreased by 1.
    int
    Absolute distance between this priority and prio.
    PriorityManager this priority instance belongs to.
    int
    Returns the priority as an integer.
    boolean
    True, if this priority is higher than prio, otherwise false.
    Returns the current priority increased by 1.
    boolean
    True, if this priority is lower or equal to prio, otherwise false.
    void
    setTo(IPriority priority)
    Sets this priority to the same value as priority.
    void
    setValue(int value)
    Sets the value of the priority according to its original specification.
  • Method Details

    • getManager

      IPriorityManager getManager()
      PriorityManager this priority instance belongs to.
      Returns:
    • distance

      int distance(IPriority prio)
      Absolute distance between this priority and prio.
      Parameters:
      prio -
      Returns:
    • absoluteValue

      int absoluteValue()
      Returns the priority value adjusted to a rage from 0..n. Whereby 0 represents the lowest and n the highest priority values.
      Returns:
    • getValue

      int getValue()
      Returns the priority as an integer. Depends on the original specification.
      Returns:
    • setValue

      void setValue(int value)
      Sets the value of the priority according to its original specification.
      Parameters:
      value -
    • increase

      IPriority increase()
      Returns the current priority increased by 1.
    • decrease

      IPriority decrease()
      Returns the current priority decreased by 1.
    • lessOrEqual

      boolean lessOrEqual(IPriority prio)
      True, if this priority is lower or equal to prio, otherwise false.
      Parameters:
      prio -
      Returns:
    • greaterThan

      boolean greaterThan(IPriority prio)
      True, if this priority is higher than prio, otherwise false.
      Parameters:
      prio -
      Returns:
    • clone

      IPriority clone()
      Creates a copy of this priority instance.
      Returns:
    • setTo

      void setTo(IPriority priority)
      Sets this priority to the same value as priority.
      Parameters:
      priority -
    • addBonus

      IPriority addBonus(int bonus)
      Returns the value of this priority plus the given bonus. This method ensures that the new priority lies in the given borders (lowest and highest priority).
      Parameters:
      bonus -