Queue.java presents a Queue of linked nodes built "from scratch" whose integrity cannot be violated (unlike Java's Queue class). Uses ann.util.SinglyLinkedNode to store its values.
Default constructorPostcondition: Empty stack is constructed.
Check if queue is emptyReturn: true if queue is empty, and false otherwise
First operationReturn: Object at the front of the queue; null if queue is empty
Add operationReceive: Object value
Postcondition: value has been added at the back of the queue
Remove operationReturn: Object at the front of the queue; null if queue is empty
Postcondition: Value at the front of the queue has been removed.
Size accessorReturn: number of elements in the queue
Clear mutatorPostcondition: All values have been removed from the queue.
String conversion for output purposes
Back to the package documentation index