|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Queue<T>
An Abstract queue. It should implement FIFO semantics.
Method Summary | |
---|---|
long |
deleteMatchedItems(org.apache.commons.collections.Predicate matcher)
All objects in the queue where matcher.match(object)
returns true will be deleted from the queue. |
T |
dequeue()
remove an entry from the start of the queue |
void |
enqueue(T obj)
Add an entry to the end of queue |
java.util.Iterator<T> |
getIterator(boolean inCacheOnly)
Returns an iterator for the queue. |
boolean |
isEmpty()
is the queue empty? |
long |
length()
get the number of elements in the queue |
T |
peek()
Give the top object in the queue, leaving it in place to be returned by future peek() or dequeue() invocations. |
void |
release()
release any OS/IO resources associated with Queue |
void |
unpeek()
Releases queue from the obligation to return in the next peek()/dequeue() the same object as returned by any previous peek(). |
Method Detail |
---|
void enqueue(T obj)
obj
- the entry to queueboolean isEmpty()
true
if the queue has no elementsT dequeue() throws java.util.NoSuchElementException
java.util.NoSuchElementException
long length()
void release()
T peek()
void unpeek()
java.util.Iterator<T> getIterator(boolean inCacheOnly)
The returned iterator's remove
method is considered
unsafe.
Editing the queue while using the iterator is not safe.
inCacheOnly
-
long deleteMatchedItems(org.apache.commons.collections.Predicate matcher)
matcher.match(object)
returns true will be deleted from the queue.
Making other changes to the queue while this method is being processed is not safe.
matcher
- a predicate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |