|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.archive.queue.DiskBackedQueue
org.archive.queue.DiskBackedDeque
public class DiskBackedDeque
Field Summary | |
---|---|
protected DiskStack |
stack
|
Fields inherited from class org.archive.queue.DiskBackedQueue |
---|
DISCARD_BACKING_THRESHOLD, headMax, headQ, name, tailQ |
Constructor Summary | |
---|---|
DiskBackedDeque(java.io.File dir,
java.lang.String name,
boolean reuse,
int headMax)
|
Method Summary | |
---|---|
protected java.lang.Object |
backingDequeue()
|
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. |
protected void |
discardBacking()
|
void |
disconnect()
Release any file-handles in arecoverable way. |
java.util.Iterator |
getIterator(boolean inCacheOnly)
Returns an iterator for the queue. |
protected int |
headTargetSize()
|
long |
height()
Number of items in the Stack. |
boolean |
isEmpty()
is the queue empty? |
long |
length()
get the number of elements in the queue |
int |
memoryLoad()
|
java.lang.Object |
peek()
Give the top object in the queue, leaving it in place to be returned by future peek() or dequeue() invocations. |
java.lang.Object |
pop()
Remove and return item from top of Stack |
void |
push(java.lang.Object object)
Add object to top of Stack |
void |
setHeadMax(int hm)
Set the number of items to keep in memory, and adjust current head to match. |
Methods inherited from class org.archive.queue.DiskBackedQueue |
---|
backingUpdate, canDiscardBacking, dequeue, enqueue, fillHeadQ, release, unpeek |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.archive.queue.Queue |
---|
dequeue, enqueue, release, unpeek |
Methods inherited from interface org.archive.queue.Stack |
---|
release |
Field Detail |
---|
protected DiskStack stack
Constructor Detail |
---|
public DiskBackedDeque(java.io.File dir, java.lang.String name, boolean reuse, int headMax) throws java.io.IOException
dir
- name
- reuse
- headMax
-
java.io.IOException
Method Detail |
---|
public void push(java.lang.Object object)
Stack
push
in interface Stack
public void setHeadMax(int hm)
setHeadMax
in class DiskBackedQueue
hm
- public java.lang.Object pop()
Stack
pop
in interface Stack
public java.lang.Object peek()
Queue
peek
in interface Queue
peek
in interface Stack
peek
in class DiskBackedQueue
Queue.peek()
public long height()
Stack
height
in interface Stack
protected java.lang.Object backingDequeue()
backingDequeue
in class DiskBackedQueue
protected void discardBacking()
discardBacking
in class DiskBackedQueue
public long deleteMatchedItems(org.apache.commons.collections.Predicate matcher)
Queue
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.
deleteMatchedItems
in interface Queue
deleteMatchedItems
in class DiskBackedQueue
matcher
- a predicate
Queue.deleteMatchedItems(org.apache.commons.collections.Predicate)
public java.util.Iterator getIterator(boolean inCacheOnly)
Queue
The returned iterator's remove
method is considered
unsafe.
Editing the queue while using the iterator is not safe.
getIterator
in interface Queue
getIterator
in class DiskBackedQueue
Queue.getIterator(boolean)
protected int headTargetSize()
headTargetSize
in class DiskBackedQueue
public boolean isEmpty()
Queue
isEmpty
in interface Queue
isEmpty
in interface Stack
isEmpty
in class DiskBackedQueue
true
if the queue has no elementsQueue.isEmpty()
public long length()
Queue
length
in interface Queue
length
in class DiskBackedQueue
Queue.length()
public void disconnect()
DiskBackedQueue
disconnect
in class DiskBackedQueue
public int memoryLoad()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |