A Queue is a FIFO (rst in, rst out) data structure. Given the following queue interface:
public interface Queue {
int size(); // current queue size
boolean isEmpty(); // true if queue is empty
void enqueue(Object element); // add element at end of queue
Object dequeue(); // return and remove first element.
Object first(); // return (without removing) first element
Object last(); // return (without removing) last element
Iterator iterator(); // element iterator
}
The iterator iterates over all elements of the queue. Operations not allowed on an empty queue shall generate an unchecked exception.
Do the following:
Create a linked implementation (LinkedQueue.java) of the interface Queue.
Write a test program QueueMain.java, showing how all methods work.
Create Javadoc comments in the code and generate good-looking and extensive
HTML documentation for the interface and the class. All public class members shall be documented.
Note:
The implementation shall be linked, i.e. a sequence of linked nodes where each node represents an element.
You may not use any of the predened classes in the Java library.
In the report, the HTML pages generated by the classes Queue and LinkedQueue shall be attached. Attach no other HTML pages!
Check the extra slides before you start.