|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.collection.SynchronizedCollection<E> org.apache.commons.collections.buffer.SynchronizedBuffer<E>
public class SynchronizedBuffer<E>
Decorates another Buffer
to synchronize its behaviour
for a multi-threaded environment.
Field Summary |
---|
Fields inherited from class org.apache.commons.collections.collection.SynchronizedCollection |
---|
collection, lock |
Constructor Summary | |
---|---|
protected |
SynchronizedBuffer(Buffer<E> buffer)
Constructor that wraps (not copies). |
protected |
SynchronizedBuffer(Buffer<E> buffer,
Object lock)
Constructor that wraps (not copies). |
Method Summary | ||
---|---|---|
static
|
decorate(Buffer<E> buffer)
Factory method to create a synchronized buffer. |
|
E |
get()
Gets the next object from the buffer without removing it. |
|
protected Buffer<E> |
getBuffer()
Gets the buffer being decorated. |
|
E |
remove()
Gets and removes the next object from the buffer. |
Methods inherited from class org.apache.commons.collections.collection.SynchronizedCollection |
---|
add, addAll, clear, contains, containsAll, decorate, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
Constructor Detail |
---|
protected SynchronizedBuffer(Buffer<E> buffer)
buffer
- the buffer to decorate, must not be null
IllegalArgumentException
- if the buffer is nullprotected SynchronizedBuffer(Buffer<E> buffer, Object lock)
buffer
- the buffer to decorate, must not be nulllock
- the lock object to use, must not be null
IllegalArgumentException
- if the buffer is nullMethod Detail |
---|
public static <E> Buffer<E> decorate(Buffer<E> buffer)
buffer
- the buffer to decorate, must not be null
IllegalArgumentException
- if buffer is nullprotected Buffer<E> getBuffer()
public E get()
Buffer
get
in interface Buffer<E>
public E remove()
Buffer
remove
in interface Buffer<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |