java.lang.Object
edu.kit.ipd.sdq.pcm.simulation.scheduler.exact.priority.impl.PriorityImpl
All Implemented Interfaces:
IPriority, Cloneable

public class PriorityImpl extends Object implements IPriority
  • Field Details

    • manager

      protected PriorityManagerImpl manager
    • value

      protected int value
    • absolute_value

      protected int absolute_value
  • Constructor Details

  • Method Details

    • absoluteValue

      public int absoluteValue()
      Description copied from interface: IPriority
      Returns the priority value adjusted to a rage from 0..n. Whereby 0 represents the lowest and n the highest priority values.
      Specified by:
      absoluteValue in interface IPriority
      Returns:
    • getManager

      public IPriorityManager getManager()
      Description copied from interface: IPriority
      PriorityManager this priority instance belongs to.
      Specified by:
      getManager in interface IPriority
      Returns:
    • greaterThan

      public boolean greaterThan(IPriority prio)
      Description copied from interface: IPriority
      True, if this priority is higher than prio, otherwise false.
      Specified by:
      greaterThan in interface IPriority
      Returns:
    • lessOrEqual

      public boolean lessOrEqual(IPriority prio)
      Description copied from interface: IPriority
      True, if this priority is lower or equal to prio, otherwise false.
      Specified by:
      lessOrEqual in interface IPriority
      Returns:
    • increase

      public IPriority increase()
      Description copied from interface: IPriority
      Returns the current priority increased by 1.
      Specified by:
      increase in interface IPriority
    • decrease

      public IPriority decrease()
      Description copied from interface: IPriority
      Returns the current priority decreased by 1.
      Specified by:
      decrease in interface IPriority
    • distance

      public int distance(IPriority prio)
      Description copied from interface: IPriority
      Absolute distance between this priority and prio.
      Specified by:
      distance in interface IPriority
      Returns:
    • getValue

      public int getValue()
      Description copied from interface: IPriority
      Returns the priority as an integer. Depends on the original specification.
      Specified by:
      getValue in interface IPriority
      Returns:
    • setValue

      public void setValue(int value)
      Description copied from interface: IPriority
      Sets the value of the priority according to its original specification.
      Specified by:
      setValue in interface IPriority
    • setTo

      public void setTo(IPriority priority)
      Description copied from interface: IPriority
      Sets this priority to the same value as priority.
      Specified by:
      setTo in interface IPriority
    • addBonus

      public IPriority addBonus(int bonus)
      Description copied from interface: IPriority
      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).
      Specified by:
      addBonus in interface IPriority
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • clone

      public IPriority clone()
      Description copied from interface: IPriority
      Creates a copy of this priority instance.
      Specified by:
      clone in interface IPriority
      Overrides:
      clone in class Object
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object