m865.datastructures
Interface Prioritizeable

All Superinterfaces:
java.lang.Comparable
All Known Implementing Classes:
PrioritizedItem

public interface Prioritizeable
extends java.lang.Comparable

This interface defines the three key methods required for an object to be Prioritizeable.

Version:
2.1 09/26/05
Author:
Daniel D. Warner

Method Summary
 boolean adjustPriority(java.lang.Comparable obj)
          A prioritizable object can have its priority raised or lowered.
 boolean higherThan(Prioritizeable obj)
          Compares the priority of this Prioritizeable object with the priority of the specified Prioritizeable object.
 boolean lowerThan(Prioritizeable obj)
          Compares the priority of this Prioritizeable object with the priority of the specified Prioritizeable object.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

higherThan

public boolean higherThan(Prioritizeable obj)
Compares the priority of this Prioritizeable object with the priority of the specified Prioritizeable object.

Parameters:
obj - the specified Prioritizeable object. If the objects are not comparable, then the method may throw a ClassCastException.
Returns:
true if this object has priority equal to or higher than the specified object.

lowerThan

public boolean lowerThan(Prioritizeable obj)
Compares the priority of this Prioritizeable object with the priority of the specified Prioritizeable object.

Parameters:
obj - the specified Prioritizeable object. If the objects are not comparable, then the method may throw a ClassCastException.
Returns:
true if this object has priority strictly lower than the specified object.

adjustPriority

public boolean adjustPriority(java.lang.Comparable obj)
A prioritizable object can have its priority raised or lowered.

Parameters:
obj - a Comparable object appropriate for specifying the priority.
Returns:
true if this object has a priority that is equal to or higher than before.