org.apache.commons.collections.buffer |
This package contains implementations of the
{@link org.apache.commons.collections.Buffer Buffer} interface.
The following implementations are provided in the package:
- PriorityBuffer - provides for removal based on a comparator ordering
- BoundedFifoBuffer - implements a buffer with a fixed size that throws exceptions when full
- CircularFifoBuffer - implements a buffer with a fixed size that discards oldest when full
- UnboundedFifoBuffer - implements a buffer that grows in size if necessary
The following decorators are provided in the package:
- Synchronized - synchronizes method access for multi-threaded environments
- Unmodifiable - ensures the collection cannot be altered
- Predicated - ensures that only elements that are valid according to a predicate can be added
- Typed - ensures that only elements that are of a specific type can be added
- Transformed - transforms elements added to the buffer
- Blocking - blocks on get and remove until an element is available
|
Java Source File Name | Type | Comment |
AbstractBufferDecorator.java | Class | Decorates another Buffer to provide additional behaviour. |
BlockingBuffer.java | Class | Decorates another Buffer to make
BlockingBuffer.get() and
BlockingBuffer.remove() block when the Buffer is empty. |
BoundedBuffer.java | Class | Decorates another Buffer to ensure a fixed maximum size.
Note: This class should only be used if you need to add bounded
behaviour to another buffer. |
BoundedFifoBuffer.java | Class | The BoundedFifoBuffer is a very efficient implementation of
Buffer that is of a fixed size.
The removal order of a BoundedFifoBuffer is based on the
insertion order; elements are removed in the same order in which they
were added. |
CircularFifoBuffer.java | Class | CircularFifoBuffer is a first in first out buffer with a fixed size that
replaces its oldest element if full.
The removal order of a CircularFifoBuffer is based on the
insertion order; elements are removed in the same order in which they
were added. |
PredicatedBuffer.java | Class | Decorates another Buffer to validate that additions
match a specified predicate. |
PriorityBuffer.java | Class | Binary heap implementation of Buffer that provides for
removal based on Comparator ordering.
The removal order of a binary heap is based on either the natural sort
order of its elements or a specified
Comparator . |
SynchronizedBuffer.java | Class | Decorates another Buffer to synchronize its behaviour
for a multi-threaded environment. |
TestAll.java | Class | Entry point for tests. |
TestBlockingBuffer.java | Class | Extension of
AbstractTestObject for exercising the
BlockingBuffer implementation. |
TestBoundedBuffer.java | Class | |
TestBoundedFifoBuffer.java | Class | Test cases for BoundedFifoBuffer. |
TestBoundedFifoBuffer2.java | Class | Runs tests against a full BoundedFifoBuffer, since many of the algorithms
differ depending on whether the fifo is full or not. |
TestCircularFifoBuffer.java | Class | Test cases for CircularFifoBuffer. |
TestPredicatedBuffer.java | Class | Extension of
TestPredicatedCollection for exercising the
PredicatedBuffer implementation. |
TestPriorityBuffer.java | Class | Tests the PriorityBuffer.
version: $Revision: 307292 $ $Date: 2005-10-08 13:49:53 +0100 (Sat, 08 Oct 2005) $ author: Michael A. |
TestSynchronizedBuffer.java | Class | Extension of
AbstractTestCollection for exercising the
SynchronizedBuffer implementation. |
TestTransformedBuffer.java | Class | Extension of
TestBuffer for exercising the
TransformedBuffer implementation. |
TestUnboundedFifoBuffer.java | Class | Test cases for UnboundedFifoBuffer. |
TestUnmodifiableBuffer.java | Class | Extension of
AbstractTestCollection for exercising the
UnmodifiableBuffer implementation. |
TransformedBuffer.java | Class | Decorates another Buffer to transform objects that are added. |
TypedBuffer.java | Class | Decorates another Buffer to validate that elements added
are of a specific type.
The validation of additions is performed via an instanceof test against
a specified Class . |
UnboundedFifoBuffer.java | Class | UnboundedFifoBuffer is a very efficient implementation of
Buffer that can grow to any size.
According to performance testing, it exhibits a constant access time, but it
also outperforms ArrayList when used for the same purpose.
The removal order of an UnboundedFifoBuffer is based on the insertion
order; elements are removed in the same order in which they were added.
The iteration order is the same as the removal order.
The
UnboundedFifoBuffer.remove() and
UnboundedFifoBuffer.get() operations perform in constant time.
The
UnboundedFifoBuffer.add(Object) operation performs in amortized constant time. |
UnmodifiableBuffer.java | Class | Decorates another Buffer to ensure it can't be altered. |