public interface Queue { public int size(); // current queue size public boolean isEmpty(); // true if queue is empty public void enqueue(Object element); // add element at end of queue public Object dequeue(); // return and remove first element. public Object first(); // return (without removing) first element public Object last(); // return (without removing) last element public String toString(); // return a string representation of the queue content public Iterator<Object> iterator(); // element iterator }The iterator iterates over all elements of the queue. Operations not allowed on an empty queue shall generate an unchecked exception. Tasks:
If erroneous values of the integers are read, an error message should be printed and the upper pane should not be updated. The most important thing is that the program is working properly. It is also important for the program to have a good structure to make it easy to follow and to understand. Divide big methods and big classes into smaller ones, if necessary.