
E - the type of elements maintained by this bufferpublic interface Buffer<E>
| Modifier and Type | Field and Description |
|---|---|
static int |
FAILED |
static int |
FULL |
static int |
SUCCESS |
| Modifier and Type | Method and Description |
|---|---|
void |
drainTo(Consumer<E> consumer)
Drains the buffer, sending each element to the consumer for processing.
|
int |
offer(E e)
Inserts the specified element into this buffer if it is possible to do so immediately without
violating capacity restrictions.
|
int |
reads()
Returns the number of elements that have been read from the buffer.
|
default int |
size()
Returns the number of elements residing in the buffer.
|
int |
writes()
Returns the number of elements that have been written to the buffer.
|
static final int FULL
static final int SUCCESS
static final int FAILED
int offer(E e)
e - the element to add1 if the buffer is full, -1 if the CAS failed, or 0 if addedvoid drainTo(Consumer<E> consumer)
consumer - the action to perform on each elementdefault int size()
int reads()
int writes()
Copyright © 2009–2025 OrientDB. All rights reserved.