The BoundedFifoBuffer is a very efficient implementation of
Buffer that does not alter the size of the buffer at runtime.
The removal order of a BoundedFifoBuffer 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
BoundedFifoBuffer.add(Object) ,
BoundedFifoBuffer.remove() and
BoundedFifoBuffer.get() operations
all perform in constant time. All other operations perform in linear
time or worse.
Note that this implementation is not synchronized. The following can be
used to provide synchronized access to your BoundedFifoBuffer :
Buffer fifo = BufferUtils.synchronizedBuffer(new BoundedFifoBuffer());
This buffer prevents null objects from being added.
since: 2.1 version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $ author: Avalon author: Berin Loritsch author: Paul Jack author: Stephen Colebourne author: Herve Quiroz |