public abstract static class Queues.SimpleQueue<E>
extends java.lang.Object
implements java.util.concurrent.BlockingQueue<E>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Queues.SimpleQueue.Node<E> |
protected static class |
Queues.SimpleQueue.NodeSerializer<E> |
| Modifier and Type | Field and Description |
|---|---|
protected Engine |
engine |
protected Atomic.Long |
head |
protected java.util.concurrent.locks.ReentrantLock[] |
locks |
protected Serializer<Queues.SimpleQueue.Node<E>> |
nodeSerializer |
protected Serializer<E> |
serializer |
protected static int |
TICK |
protected boolean |
useLocks |
| Constructor and Description |
|---|
SimpleQueue(Engine engine,
Serializer<E> serializer,
long headRecidRef,
boolean useLocks) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAll(java.util.Collection<? extends E> c) |
void |
clear() |
void |
close()
Closes underlying storage and releases all resources.
|
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
int |
drainTo(java.util.Collection<? super E> c) |
int |
drainTo(java.util.Collection<? super E> c,
int maxElements) |
E |
element() |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
boolean |
offer(E e) |
boolean |
offer(E e,
long timeout,
java.util.concurrent.TimeUnit unit) |
E |
peek() |
E |
poll() |
E |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
put(E e) |
int |
remainingCapacity() |
E |
remove() |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
E |
take() |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected final boolean useLocks
protected final java.util.concurrent.locks.ReentrantLock[] locks
protected static final int TICK
protected final Engine engine
protected final Serializer<E> serializer
protected final Atomic.Long head
protected final Serializer<Queues.SimpleQueue.Node<E>> nodeSerializer
public SimpleQueue(Engine engine, Serializer<E> serializer, long headRecidRef, boolean useLocks)
public void close()
public void clear()
clear in interface java.util.Collection<E>public boolean offer(E e)
public void put(E e) throws java.lang.InterruptedException
put in interface java.util.concurrent.BlockingQueue<E>java.lang.InterruptedExceptionpublic boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
offer in interface java.util.concurrent.BlockingQueue<E>java.lang.InterruptedExceptionpublic E take() throws java.lang.InterruptedException
take in interface java.util.concurrent.BlockingQueue<E>java.lang.InterruptedExceptionpublic E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
poll in interface java.util.concurrent.BlockingQueue<E>java.lang.InterruptedExceptionpublic int drainTo(java.util.Collection<? super E> c)
drainTo in interface java.util.concurrent.BlockingQueue<E>public int drainTo(java.util.Collection<? super E> c, int maxElements)
drainTo in interface java.util.concurrent.BlockingQueue<E>public int remainingCapacity()
remainingCapacity in interface java.util.concurrent.BlockingQueue<E>public boolean isEmpty()
isEmpty in interface java.util.Collection<E>public int size()
size in interface java.util.Collection<E>public boolean contains(java.lang.Object o)
public java.util.Iterator<E> iterator()
public java.lang.Object[] toArray()
toArray in interface java.util.Collection<E>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<E>public boolean remove(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<E>public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>