1: public T dequeue()
2: {
3: T front = getFront(); // Might throw EmptyQueueException
4: assert firstNode != null;
5: firstNode.setData(null);
6: firstNode = firstNode.getNextNode();
7:
8: if (firstNode == null)
9: lastNode = null;
10:
11: return front;
12: } // end dequeue
13: // Version 4.0