I have 2 error messages regarding the 2 exceptions which i have highlighted in bold in the code snippet below, can someone please tell me if i need some additional code as I am not to sure why it is not compiling
package supermarketproject;
import SuperMarketProject.LinearNode;
import SuperMarketProject.QueueADT;
public class LinkedQueue<T> implements QueueADT<T>
{
private int count;
private LinearNode<T> front, rear;
/**
* Creates an empty queue.
*/
public LinkedQueue()
{
count = 0;
front = rear = null;
}
public boolean isEmpty( ) {
return front == null;
}
/**
* Adds the specified element to the rear of this queue.
*
* @param element the element to be added to the rear of this queue
*/
public void enqueue (T element)
{
LinearNode<T> node = new LinearNode<T>(element);
if (isEmpty())
front = node;
else
rear.setNext (node);
rear = node;
count++;
}
public T dequeue() throws EmptyCollectionException
{
if (isEmpty())
throw new EmptyCollectionException ("queue");
T result = front.getElement();
front = front.getNext();
count--;
if (isEmpty())
rear = null;
return result;
}
public class ElementNotFoundException extends RuntimeException{
/**
* Sets up this exception with an appropriate message.
*/
public ElementNotFoundException (String collection)
{
super ("The target element is not in this " + collection);
}
}
/**
* EmptyCollectionException represents the situation in which a collection
* is empty.
*/
public class EmptyCollectionException extends RuntimeException{
/**
* Sets up this exception with an appropriate message.
*/
public EmptyCollectionException (String collection)
{
super ("The " + collection + " is empty.");
}
}
@Override
public T first() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public int size() {
throw new UnsupportedOperationException("Not supported yet.");
}
}