Package org.jctools.queues
Class FloatingCountersSpscConcurrentArrayQueue<E>
- java.lang.Object
-
- org.jctools.queues.FloatingCountersSpscConcurrentArrayQueue<E>
-
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Queue<E>
public final class FloatingCountersSpscConcurrentArrayQueue<E> extends Object implements Queue<E>
-
-
Field Summary
Fields Modifier and Type Field Description protected E[]bufferprotected static intBUFFER_PADprotected intcapacityprotected PaddedAtomicLongheadprotected PaddedAtomicLongheadCacheprotected longmaskprotected static intSPARSE_SHIFTprotected PaddedAtomicLongtailprotected PaddedAtomicLongtailCache
-
Constructor Summary
Constructors Constructor Description FloatingCountersSpscConcurrentArrayQueue(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
-
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
-
tail
protected final PaddedAtomicLong tail
-
head
protected final PaddedAtomicLong head
-
tailCache
protected final PaddedAtomicLong tailCache
-
headCache
protected final PaddedAtomicLong headCache
-
-
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>
-
-