Additional top-level class in compilation unit: BBHeader.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | BUFFER_SIZE
The maximum number of elements per buffer. |
| pack-priv static final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected Buffer | create(E
the producer's element e)Implements abstract com. |
| BUFFER_SIZE | back to summary |
|---|---|
| pack-priv static final int BUFFER_SIZE The maximum number of elements per buffer. | |
| MASK | back to summary |
|---|---|
| pack-priv static final int MASK | |
| BoundedBuffer | back to summary |
|---|---|
| pack-priv BoundedBuffer() | |
| create | back to summary |
|---|---|
| protected Buffer Implements abstract com. Doc from com. Creates a new buffer instance after resizing to accommodate a producer. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final VarHandle | |
| pack-priv final Object[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | drainTo(Consumer<E>
the action to perform on each element consumer)Implements com. |
| public int | offer(E
the element to add e)Implements com. |
| public long | reads()
Implements com. |
| public long | writes()
Implements com. |
| BUFFER | back to summary |
|---|---|
| pack-priv static final VarHandle BUFFER | |
| buffer | back to summary |
|---|---|
| pack-priv final Object[] buffer | |
| RingBuffer | back to summary |
|---|---|
| public RingBuffer(E e) | |
| drainTo | back to summary |
|---|---|
| public void drainTo(Consumer<E> consumer) Implements com. Doc from com. Drains the buffer, sending each element to the consumer for processing. The caller must ensure that a consumer has exclusive read access to the buffer. | |
| offer | back to summary |
|---|---|
| public int offer(E e) Implements com. Doc from com. Inserts the specified element into this buffer if it is possible to do so immediately without violating capacity restrictions. The addition is allowed to fail spuriously if multiple threads insert concurrently.
| |
| reads | back to summary |
|---|---|
| public long reads() Implements com. Doc from com. Returns the number of elements that have been read from the buffer.
| |
| writes | back to summary |
|---|---|
| public long writes() Implements com. Doc from com. Returns the number of elements that have been written to the buffer.
| |