public class SynchronizedBuffer extends SynchronizedCollection implements Buffer
Buffer to synchronize its behaviour
for a multi-threaded environment.
Methods are synchronized, then forwarded to the decorated buffer.
This class is Serializable from Commons Collections 3.1.
collection, lock| Modifier | Constructor and Description |
|---|---|
protected |
SynchronizedBuffer(Buffer buffer)
Constructor that wraps (not copies).
|
protected |
SynchronizedBuffer(Buffer buffer,
java.lang.Object lock)
Constructor that wraps (not copies).
|
| Modifier and Type | Method and Description |
|---|---|
static Buffer |
decorate(Buffer buffer)
Factory method to create a synchronized buffer.
|
java.lang.Object |
get()
Gets the next object from the buffer without removing it.
|
protected Buffer |
getBuffer()
Gets the buffer being decorated.
|
java.lang.Object |
remove()
Gets and removes the next object from the buffer.
|
add, addAll, clear, contains, containsAll, decorate, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitprotected SynchronizedBuffer(Buffer buffer)
buffer - the buffer to decorate, must not be nulljava.lang.IllegalArgumentException - if the buffer is nullprotected SynchronizedBuffer(Buffer buffer, java.lang.Object lock)
buffer - the buffer to decorate, must not be nulllock - the lock object to use, must not be nulljava.lang.IllegalArgumentException - if the buffer is nullpublic static Buffer decorate(Buffer buffer)
buffer - the buffer to decorate, must not be nulljava.lang.IllegalArgumentException - if buffer is nullprotected Buffer getBuffer()
public java.lang.Object get()
BufferCopyright © 2001-2025 Apache Software Foundation. All Rights Reserved.