|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstockportfolio.ObjectDQueue
An enhanced queue. Can addToFront, and get the elements by idenx.
Constructor Summary | |
ObjectDQueue()
|
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 |
dequeue()
Remove an object from the queue. |
boolean |
enqueue(java.lang.Object newValue)
Push a new object on the queue. |
java.lang.Object |
front()
Look at the front of the queue. |
java.lang.Object |
getObject(int index)
Get an object from the queue. |
boolean |
isEmpty()
Tell whether the queue is empty. |
boolean |
isFull()
Tell whether the queue is full. |
int |
size()
Tells how many objects are currently in the queue. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ObjectDQueue()
Method Detail |
public boolean addToFront(java.lang.Object newValue)
IDQueue
addToFront
in interface IDQueue
newValue
- a non-null object
public java.lang.Object getObject(int index)
IDQueue
getObject
in interface IDQueue
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.
public java.lang.Object dequeue()
IQueue
dequeue
in interface IQueue
public boolean enqueue(java.lang.Object newValue)
IQueue
enqueue
in interface IQueue
newValue
- a non-null object
public java.lang.Object front()
IQueue
front
in interface IQueue
public boolean isEmpty()
IQueue
isEmpty
in interface IQueue
public boolean isFull()
IQueue
isFull
in interface IQueue
public int size()
IQueue
size
in interface IQueue
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |