[
RCOS.java Home
|
RCOS Home
|
David's Home
]
PriorityQueue
CRC
Name:
PriorityQueue
Comment:
basic queue class, used for most scheduling algorithms
Collaborators:
Responsibilities:
Insert( Object theObject )
- insert object into Q in order
Object theObject = Retrieve()
- get a copy and remove item from head of Q
GoToHead()
- move a tmp pointer to the head of Q
Boolean possible = GoToNext()
- move tmp pointer to next item in Q (return TRUE if able, FALSE otherwise)
Boolean possible = GoToPrevious()
- move tmp pointer to previous item in Q (return TRUE if able, FALSE otherwise)
GoToTail()
- move tmp pointer to the tail of Q
Object theObject = Peek()
- return copy of item at tmp pointer (but don't remove it from the Q)
Boolean theResult = IsEmpty()
- return TRUE if Q is empty
int theCount = ItemCount()
- return number of items in Q
int theResult = Compare( Object first, second )
- take two items and return -1, 0, 1 if first item is <, =, > the second item