This interface does not define most of the java.
or java. methods as the intended usage of SimpleQueue
does not require support for iteration or introspection.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | |
| public boolean | Returns: true if successful, false if the value was not enqueued likely due to reaching the queue capacity)the value to enqueue, not null value)Atomically enqueue a single value. |
| public boolean | Returns: true if successful, false if the value was not enqueued likely due to reaching the queue capacity)the first value to enqueue, not null v1, T the second value to enqueue, not null v2)Atomically enqueue two values. |
| public T | Returns: the item or null to indicate an empty queueTries to dequeue a value (non-null) or returns null if the queue is empty. |
| clear | back to summary |
|---|---|
| public void clear() Removes all enqueued items from this queue. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns true if the queue is empty.
Note however that due to potential fused functions in
| |
| offer | back to summary |
|---|---|
| public boolean offer(T value) Atomically enqueue a single value.
| |
| offer | back to summary |
|---|---|
| public boolean offer(T v1, T v2) Atomically enqueue two values.
| |
| poll | back to summary |
|---|---|
| public T poll() throws Throwable Tries to dequeue a value (non-null) or returns null if the queue is empty.
If the producer uses | |