Interface IPriority
-
- All Superinterfaces:
Cloneable
- All Known Implementing Classes:
PriorityImpl
public interface IPriority extends Cloneable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
absoluteValue()
Returns the priority value adjusted to a rage from 0..n.IPriority
addBonus(int bonus)
Returns the value of this priority plus the given bonus.IPriority
clone()
Creates a copy of this priority instance.IPriority
decrease()
Returns the current priority decreased by 1.int
distance(IPriority prio)
Absolute distance between this priority and prio.IPriorityManager
getManager()
PriorityManager this priority instance belongs to.int
getValue()
Returns the priority as an integer.boolean
greaterThan(IPriority prio)
True, if this priority is higher than prio, otherwise false.IPriority
increase()
Returns the current priority increased by 1.boolean
lessOrEqual(IPriority prio)
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 Detail
-
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
-
-
-