+ /** Add an element to the front of the queue */
+ public synchronized void prepend(Object o) {
+ if (size == vec.length) grow(vec.length * 2);
+ first--;
+ if (first < 0) first += vec.length;
+ vec[first] = o;
+ size++;
+ if (size == 1) notify();
+ }
+
+ /** Add an element to the back of the queue */