public class FileQueue<T extends Serializable> extends Object implements Queue<T>
Modifier and Type | Field and Description |
---|---|
static int |
EMPTY_POINTER |
static int |
HEADER_SIZE |
static int |
LONG_SIZE |
Constructor and Description |
---|
FileQueue(File queueFile)
Creates a new
FileQueue that stores items in a specified file. |
FileQueue(String filename)
Creates a new
FileQueue that stores items in a file on a specified path. |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T item) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
T |
element() |
boolean |
isEmpty() |
Iterator<T> |
iterator() |
boolean |
offer(T e) |
T |
peek() |
T |
poll() |
T |
remove() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<U> U[] |
toArray(U[] a) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public static final int EMPTY_POINTER
public static final int LONG_SIZE
public static final int HEADER_SIZE
public FileQueue(String filename) throws PerfCakeException
FileQueue
that stores items in a file on a specified path.filename
- Path to the file to store queue items.PerfCakeException
- When it was not possible to create or open the file.public FileQueue(File queueFile) throws PerfCakeException
FileQueue
that stores items in a specified file.queueFile
- File to store queue items.PerfCakeException
- When it was not possible to create or open the file.public boolean add(T item)
add
in interface Collection<T extends Serializable>
add
in interface Queue<T extends Serializable>
public int size()
size
in interface Collection<T extends Serializable>
public T peek()
peek
in interface Queue<T extends Serializable>
public void clear()
clear
in interface Collection<T extends Serializable>
public boolean isEmpty()
isEmpty
in interface Collection<T extends Serializable>
public boolean addAll(Collection<? extends T> c)
addAll
in interface Collection<T extends Serializable>
public boolean offer(T e)
offer
in interface Queue<T extends Serializable>
public T remove()
remove
in interface Queue<T extends Serializable>
public boolean remove(Object o)
remove
in interface Collection<T extends Serializable>
public T poll()
poll
in interface Queue<T extends Serializable>
public T element()
element
in interface Queue<T extends Serializable>
public boolean contains(Object o)
contains
in interface Collection<T extends Serializable>
public Iterator<T> iterator()
iterator
in interface Iterable<T extends Serializable>
iterator
in interface Collection<T extends Serializable>
public Object[] toArray()
toArray
in interface Collection<T extends Serializable>
public <U> U[] toArray(U[] a)
toArray
in interface Collection<T extends Serializable>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T extends Serializable>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<T extends Serializable>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<T extends Serializable>
Copyright © 2010–2017 PerfCake Community. All rights reserved.