|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.locomotive.util.FIFO
A FIFO is essentially a variable length list. Trying to stuff another object onto a full FIFO will cause the calling thread to block until one of two things occurs: another thread removes an object, freeing space for another, or the FIFO is closed (also via another thread). If the FIFO is closed, any blocked callers will be thrown a run time exception - IndexOutOfBoundsException
Constructor Summary | |
FIFO()
create a new empty FIFO with max size of 8. |
|
FIFO(int msz)
create a new FIFO, with the specified max size. |
Method Summary | |
void |
close()
close the fifo. |
boolean |
hasContents()
true if there are currently objects in the queue. |
int |
size()
current size (number of objects in the FIFO). |
boolean |
stuff(java.lang.Object o)
Stuffs an object into the FIFO. |
java.lang.Object |
yank()
Grabs the next Object off the FIFO queue. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public FIFO()
public FIFO(int msz)
msz
- the maximum number of objects in the FIFO at onceMethod Detail |
public void close()
public boolean stuff(java.lang.Object o)
o
- the object to be stuffed into the FIFOpublic java.lang.Object yank() throws java.lang.IndexOutOfBoundsException
public boolean hasContents()
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |