stockportfolio
Interface IDQueue

All Superinterfaces:
IQueue
All Known Implementing Classes:
ObjectDQueue

public interface IDQueue
extends IQueue

An enhanced queue which permits which permits additional operations, such as pushing an element on the front.


Method Summary
 boolean addToFront(java.lang.Object newValue)
          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.
 java.lang.Object getObject(int index)
          Get an object from the queue.
 
Methods inherited from interface stockportfolio.IQueue
dequeue, enqueue, front, isEmpty, isFull, size
 

Method Detail

addToFront

public boolean addToFront(java.lang.Object newValue)
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.

Parameters:
newValue - a non-null object
Returns:
true iff the object was successfully added to the queue.
Throws:
java.lang.IllegalArgumentException - if the new value is null.

getObject

public java.lang.Object getObject(int index)
Get an object from the queue. The object is not dequeued and the stack is unchanged.

Parameters:
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.
Returns:
the object corresponding to blocknum
Throws:
java.lang.IllegalArgumentException - if index is not a valid index.