/* * Created on Apr 26, 2005 */ package stockportfolio; /** An enhanced queue which permits which permits additional operations, * such as pushing an element on the front. */ public interface IDQueue extends IQueue { /** Add (push) an element to the front of the queue; thus, the next dequeue * operation would return this value, assuming there were no other * intervening addToFront operations. * @param newValue a non-null object * @return true iff the object was successfully added to the queue. * @throws IllegalArgumentException if the new value is null. */ boolean addToFront(Object newValue); /** Get an object from the queue. The object is not dequeued * and the stack is unchanged. * @param index an index number, with 0 being the oldest object * (i.e., the one at the front of the queue), 1 being * next oldest, etc. * @return the object corresponding to blocknum * @throws IllegalArgumentException if index is not a valid index. */ Object getObject(int index); }