Source of 11.14.java


  1: public T dequeue()
  2: {
  3:    checkInitialization();
  4:    if (isEmpty())
  5:       throw new EmptyQueueException();
  6:    else
  7:    {
  8:       T front = queue[frontIndex];
  9:       queue[frontIndex] = null;
 10:       frontIndex = (frontIndex + 1) % queue.length;
 11:       return front;
 12:    } // end if
 13: } // end dequeue
 14: // Version 4.0