E
- the type of elements maintained by this bufferpublic final class BoundedBuffer<E> extends Object
Constructor and Description |
---|
BoundedBuffer() |
Modifier and Type | Method and Description |
---|---|
protected Buffer<E> |
create(E e)
Creates a new buffer instance after resizing to accommodate a producer.
|
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.
|
int |
writes()
Returns the number of elements that have been written to the buffer.
|
protected Buffer<E> create(E e)
e
- the producer's elementpublic int offer(E e)
Buffer
public void drainTo(Consumer<E> consumer)
Buffer
public int reads()
Buffer
Copyright © 2009–2020 OrientDB. All rights reserved.