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 byte
CONSUMER
static int
INT_ELEMENT_SCALE
static byte
PRODUCER
-
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 int
getRequiredBufferSize(int capacity)
boolean
isEmpty()
Iterator<Integer>
iterator()
boolean
offer(Integer e)
boolean
offerInt(int e)
Integer
peek()
int
peekInt()
Integer
poll()
int
pollInt()
int
size()
-
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:
size
in interfaceCollection<Integer>
- Specified by:
size
in classAbstractCollection<Integer>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<Integer>
- Overrides:
isEmpty
in classAbstractCollection<Integer>
-
-