|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<T>
org.archive.queue.MemQueue<T>
public class MemQueue<T>
An in-memory implementation of a Queue.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
MemQueue()
Create a new, empty MemQueue |
|
| 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 o)
Add an entry to the end of queue |
java.util.Iterator<T> |
getIterator(boolean inCacheOnly)
Returns an iterator for the queue. |
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(). |
| Methods inherited from class java.util.LinkedList |
|---|
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray |
| Methods inherited from class java.util.AbstractSequentialList |
|---|
iterator |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, listIterator, removeRange, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, isEmpty, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.archive.queue.Queue |
|---|
isEmpty |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
| Methods inherited from interface java.util.Deque |
|---|
iterator |
| Constructor Detail |
|---|
public MemQueue()
| Method Detail |
|---|
public void enqueue(T o)
Queue
o - the entry to queueQueue.enqueue(Object)public T dequeue()
Queue
Queue.dequeue()public long length()
Queue
Queue.length()public void release()
Queue
Queue.release()public T peek()
Queue
peek in interface java.util.Deque<T>peek in interface java.util.Queue<T>peek in class java.util.LinkedList<T>Queue.peek()public java.util.Iterator<T> getIterator(boolean inCacheOnly)
Queue
The returned iterator's remove method is considered
unsafe.
Editing the queue while using the iterator is not safe.
Queue.getIterator(boolean)public long deleteMatchedItems(org.apache.commons.collections.Predicate matcher)
Queuematcher.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
Queue.deleteMatchedItems(org.apache.commons.collections.Predicate)public void unpeek()
Queue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||