E
- - A Serializable Classpublic class DiskQueue<E extends java.io.Serializable>
extends java.util.AbstractQueue<java.lang.String>
Constructor and Description |
---|
DiskQueue(int maxInMemorySize)
Construct a disk-backed queue that keeps at most
maxInMemorySize elements in memory. |
DiskQueue(int maxInMemorySize,
java.io.File tempDir)
Construct a disk-backed queue that keeps at most
maxInMemorySize elements in memory. |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
protected void |
finalize() |
java.util.Iterator<java.lang.String> |
iterator() |
boolean |
offer(java.lang.String element) |
java.lang.String |
peek() |
java.lang.String |
poll() |
java.lang.String |
remove() |
int |
size() |
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public DiskQueue(int maxInMemorySize)
maxInMemorySize
elements in memory.maxInMemorySize
- Maximum number of elements to keep in memory.public DiskQueue(int maxInMemorySize, java.io.File tempDir)
maxInMemorySize
elements in memory.maxInMemorySize
- Maximum number of elements to keep in memory.tempDir
- Directory where queue temporary files will be written to.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
iterator
in interface java.util.Collection<java.lang.String>
iterator
in class java.util.AbstractCollection<java.lang.String>
public int size()
size
in interface java.util.Collection<java.lang.String>
size
in class java.util.AbstractCollection<java.lang.String>
public boolean offer(java.lang.String element)
public java.lang.String peek()
public java.lang.String remove()
remove
in interface java.util.Queue<java.lang.String>
remove
in class java.util.AbstractQueue<java.lang.String>
public java.lang.String poll()
public void clear()
clear
in interface java.util.Collection<java.lang.String>
clear
in class java.util.AbstractQueue<java.lang.String>