|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.croftsoft.core.util.queue.ListQueue
public final class ListQueue
An implementation of Queue that relies upon a List backbone.
Constructor Summary | |
---|---|
ListQueue()
|
|
ListQueue(List list)
|
|
ListQueue(List list,
int maxSize)
|
Method Summary | |
---|---|
boolean |
append(Object o)
Appends the object to the queue and notifies any threads that are blocked in pull(). |
Object |
poll()
Poll this queue to see if an object is available, immediately removing one if so. |
Object |
pull()
Remove the next object in this queue, blocking until one becomes available. |
Object |
pull(long timeout)
Remove the next object in this queue, blocking until one becomes available or the given timeout period expires. |
Object |
replace(Object o)
Replaces the first occurrence of any equal object in the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListQueue(List list, int maxSize)
public ListQueue(List list)
public ListQueue()
Method Detail |
---|
public boolean append(Object o)
Queue
append
in interface Queue
public Object poll()
Queue
poll
in interface Queue
public Object pull() throws InterruptedException
Queue
pull
in interface Queue
InterruptedException
- If the wait is interrupted.public Object pull(long timeout) throws InterruptedException
Queue
pull
in interface Queue
timeout
- If positive, block for up to timeout milliseconds while
waiting for an object to be added to this queue.
If zero, block indefinitely.
InterruptedException
- If the timeout wait is interrupted.public Object replace(Object o) throws IndexOutOfBoundsException
Queue
replace
in interface Queue
IndexOutOfBoundsException
- If appending would cause the queue to exceed the maximum size.
|
CroftSoft Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |