UnboundedFifoBuffer is a very efficient buffer implementation. 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 {@link #remove()} and {@link #get()} operations perform in constant time.The {@link #add(Object)} operation performs in amortized constant time. Allother 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 UnboundedFifoBuffer
:
Buffer fifo = BufferUtils.synchronizedBuffer(new UnboundedFifoBuffer());
This buffer prevents null objects from being added.
@deprecated Moved to buffer subpackage. Due to be removed in v4.0.
@since Commons Collections 2.1
@version $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
@author Avalon
@author Federico Barbieri
@author Berin Loritsch
@author Paul Jack
@author Stephen Colebourne
@author Andreas Schlosser