Code example for Queue

Methods: add, poll, size

0
        System.out.print("Done"); 
		 
	} 
	 
	public void push(Float f){ 
		this.values.add(f); 
		 
		if (values.size() > this.maxlength){ 
			values.poll();	 
		} 
	} 
	 
	public Float average(){ 
		Iterator it=this.values.iterator(); 
		int i = 0; 
		Float result = (float) 0; 
        while(it.hasNext()) 
        { 
            i++; 
        	Float iteratorValue=(Float)it.next(); 
            result+=iteratorValue;