Package org.jctools.queues
Class InlinedCountersSpscConcurrentArrayQueue<E>
- java.lang.Object
-
- org.jctools.queues.InlinedCountersSpscConcurrentArrayQueue<E>
-
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Queue<E>
public final class InlinedCountersSpscConcurrentArrayQueue<E> extends Object implements Queue<E>
-
-
Field Summary
Fields Modifier and Type Field Description protected E[]bufferprotected static intBUFFER_PADprotected intcapacityprotected longheadprotected longheadCacheprotected longmaskprotected static intSPARSE_SHIFTprotected longtailprotected longtailCache
-
Constructor Summary
Constructors Constructor Description InlinedCountersSpscConcurrentArrayQueue(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E e)booleanaddAll(Collection<? extends E> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)Eelement()booleanisEmpty()Iterator<E>iterator()booleanoffer(E e)Epeek()Epoll()Eremove()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Field Detail
-
head
protected volatile long head
-
tailCache
protected long tailCache
-
tail
protected volatile long tail
-
headCache
protected long headCache
-
BUFFER_PAD
protected static final int BUFFER_PAD
- See Also:
- Constant Field Values
-
SPARSE_SHIFT
protected static final int SPARSE_SHIFT
-
capacity
protected final int capacity
-
mask
protected final long mask
-
buffer
protected final E[] buffer
-
-
Method Detail
-
add
public boolean add(E e)
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<E>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<E>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<E>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAllin interfaceCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<E>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<E>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>
-
-