org.mapdb
Class Queues.SimpleQueue<E>
java.lang.Object
org.mapdb.Queues.SimpleQueue<E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>
- Direct Known Subclasses:
- Queues.CircularQueue, Queues.Queue, Queues.Stack
- Enclosing class:
- Queues
public abstract static class Queues.SimpleQueue<E>
- extends Object
- implements BlockingQueue<E>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
useLocks
protected final boolean useLocks
locks
protected final ReentrantLock[] locks
TICK
protected static final int TICK
- See Also:
- Constant Field Values
engine
protected final Engine engine
serializer
protected final Serializer<E> serializer
head
protected final Atomic.Long head
nodeSerializer
protected final Serializer<Queues.SimpleQueue.Node<E>> nodeSerializer
Queues.SimpleQueue
public Queues.SimpleQueue(Engine engine,
Serializer<E> serializer,
long headRecidRef,
boolean useLocks)
close
public void close()
- Closes underlying storage and releases all resources.
Used mostly with temporary collections where engine is not accessible.
peek
public E peek()
- Specified by:
peek in interface Queue<E>
poll
public E poll()
- Specified by:
poll in interface Queue<E>
clear
public void clear()
- Specified by:
clear in interface Collection<E>
remove
public E remove()
- Specified by:
remove in interface Queue<E>
element
public E element()
- Specified by:
element in interface Queue<E>
offer
public boolean offer(E e)
- Specified by:
offer in interface BlockingQueue<E>- Specified by:
offer in interface Queue<E>
put
public void put(E e)
throws InterruptedException
- Specified by:
put in interface BlockingQueue<E>
- Throws:
InterruptedException
offer
public boolean offer(E e,
long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
offer in interface BlockingQueue<E>
- Throws:
InterruptedException
take
public E take()
throws InterruptedException
- Specified by:
take in interface BlockingQueue<E>
- Throws:
InterruptedException
poll
public E poll(long timeout,
TimeUnit unit)
throws InterruptedException
- Specified by:
poll in interface BlockingQueue<E>
- Throws:
InterruptedException
drainTo
public int drainTo(Collection<? super E> c)
- Specified by:
drainTo in interface BlockingQueue<E>
drainTo
public int drainTo(Collection<? super E> c,
int maxElements)
- Specified by:
drainTo in interface BlockingQueue<E>
remainingCapacity
public int remainingCapacity()
- Specified by:
remainingCapacity in interface BlockingQueue<E>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Collection<E>
size
public int size()
- Specified by:
size in interface Collection<E>
contains
public boolean contains(Object o)
- Specified by:
contains in interface Collection<E>- Specified by:
contains in interface BlockingQueue<E>
iterator
public Iterator<E> iterator()
- Specified by:
iterator in interface Iterable<E>- Specified by:
iterator in interface Collection<E>
toArray
public Object[] toArray()
- Specified by:
toArray in interface Collection<E>
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray in interface Collection<E>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<E>- Specified by:
remove in interface BlockingQueue<E>
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll in interface Collection<E>
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAll in interface Collection<E>
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll in interface Collection<E>
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll in interface Collection<E>
Copyright © 2014. All Rights Reserved.