Package org.jctools.queues
Class SpscOffHeapIntQueue
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<Integer>
-
- org.jctools.queues.SpscOffHeapIntQueue
-
public final class SpscOffHeapIntQueue extends AbstractQueue<Integer>
-
-
Field Summary
Fields Modifier and Type Field Description static byteCONSUMERstatic intINT_ELEMENT_SCALEstatic bytePRODUCER
-
Constructor Summary
Constructors Constructor Description SpscOffHeapIntQueue(int capacity)SpscOffHeapIntQueue(ByteBuffer buff, int capacity, byte viewMask)This is to be used for an IPC queue with the direct buffer used being a memory mapped file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intgetRequiredBufferSize(int capacity)booleanisEmpty()Iterator<Integer>iterator()booleanoffer(Integer e)booleanofferInt(int e)Integerpeek()intpeekInt()Integerpoll()intpollInt()intsize()-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
-
-
-
Field Detail
-
PRODUCER
public static final byte PRODUCER
- See Also:
- Constant Field Values
-
CONSUMER
public static final byte CONSUMER
- See Also:
- Constant Field Values
-
INT_ELEMENT_SCALE
public static final int INT_ELEMENT_SCALE
-
-
Constructor Detail
-
SpscOffHeapIntQueue
public SpscOffHeapIntQueue(int capacity)
-
SpscOffHeapIntQueue
public SpscOffHeapIntQueue(ByteBuffer buff, int capacity, byte viewMask)
This is to be used for an IPC queue with the direct buffer used being a memory mapped file.- Parameters:
buff-capacity-viewMask-
-
-
Method Detail
-
getRequiredBufferSize
public static int getRequiredBufferSize(int capacity)
-
offer
public boolean offer(Integer e)
-
offerInt
public boolean offerInt(int e)
-
poll
public Integer poll()
-
pollInt
public int pollInt()
-
peek
public Integer peek()
-
peekInt
public int peekInt()
-
size
public int size()
- Specified by:
sizein interfaceCollection<Integer>- Specified by:
sizein classAbstractCollection<Integer>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<Integer>- Overrides:
isEmptyin classAbstractCollection<Integer>
-
-