Code example for Vector

Methods: elementAt, isEmpty, removeElementAt

0
     * is empty.  
     */ 
    public synchronized Object get() {
	Object object = peek();
	if (object != null)
	    vector.removeElementAt(0);
	return object;
    } 
 
    /** 
     * Peek to see if something is available. 
     */ 
    public Object peek() {
	if (isEmpty()) 
	    return null; 
	return vector.elementAt(0);
    } 
     
    /** 
     * Is the queue empty? 
     */ 
    public boolean isEmpty() { 
	return vector.isEmpty();
    } 
 
    /** 
     * How many elements are there in this queue? 
     */