org.apache.commons.collections.Buffer |
Known Indirect Subclasses
AbstractBufferDecorator,
ArrayStack,
BinaryHeap,
BlockingBuffer,
BoundedBuffer,
BoundedFifoBuffer,
CircularFifoBuffer,
PredicatedBuffer,
PriorityBuffer,
SynchronizedBuffer,
TransformedBuffer,
UnboundedFifoBuffer,
UnmodifiableBuffer
AbstractBufferDecorator |
Decorates another Buffer to provide additional behaviour. |
ArrayStack |
An implementation of the java.util.Stack API that is based on an
ArrayList instead of a Vector , so it is not
synchronized to protect against multi-threaded access. |
BinaryHeap |
This class is deprecated.
Replaced by PriorityBuffer in buffer subpackage.
Due to be removed in v4.0. |
BlockingBuffer |
Decorates another Buffer to make get() and
remove() block when the Buffer is empty. |
BoundedBuffer |
Decorates another Buffer to ensure a fixed maximum size. |
BoundedFifoBuffer |
This class is deprecated.
Moved to buffer subpackage. Due to be removed in v4.0. |
CircularFifoBuffer |
CircularFifoBuffer is a first in first out buffer with a fixed size that
replaces its oldest element if full. |
PredicatedBuffer |
Decorates another Buffer to validate that additions
match a specified predicate. |
PriorityBuffer |
Binary heap implementation of Buffer that provides for
removal based on Comparator ordering. |
SynchronizedBuffer |
Decorates another Buffer to synchronize its behaviour
for a multi-threaded environment. |
TransformedBuffer |
Decorates another Buffer to transform objects that are added. |
UnboundedFifoBuffer |
UnboundedFifoBuffer is a very efficient implementation of
Buffer that can grow to any size. |
UnmodifiableBuffer |
Decorates another Buffer to ensure it can't be altered. |
|
Class Overview
Defines a collection that allows objects to be removed in some well-defined order.
The removal order can be based on insertion order (eg, a FIFO queue or a
LIFO stack), on access order (eg, an LRU cache), on some arbitrary comparator
(eg, a priority queue) or on any other well-defined ordering.
Note that the removal order is not necessarily the same as the iteration
order. A Buffer
implementation may have equivalent removal
and iteration orders, but this is not required.
This interface does not specify any behavior for
equals(Object)
and hashCode()
methods. It
is therefore possible for a Buffer
implementation to also
also implement List
, Set
or
Bag
.
Summary
Public Methods |
abstract
Object
|
get()
Gets the next object from the buffer without removing it.
|
abstract
Object
|
remove()
Gets and removes the next object from the buffer.
|
[Expand]
Inherited Methods |
From interface
java.lang.Iterable
|
From interface
java.util.Collection
abstract
boolean
|
add(E arg0)
|
abstract
boolean
|
addAll(Collection<? extends E> arg0)
|
abstract
void
|
clear()
|
abstract
boolean
|
contains(Object arg0)
|
abstract
boolean
|
containsAll(Collection<?> arg0)
|
abstract
boolean
|
equals(Object arg0)
|
abstract
int
|
hashCode()
|
abstract
boolean
|
isEmpty()
|
abstract
Iterator<E>
|
iterator()
|
abstract
boolean
|
remove(Object arg0)
|
abstract
boolean
|
removeAll(Collection<?> arg0)
|
abstract
boolean
|
retainAll(Collection<?> arg0)
|
abstract
int
|
size()
|
abstract
<T>
T[]
|
toArray(T[] arg0)
|
abstract
Object[]
|
toArray()
|
|
Public Methods
public
abstract
Object
get
()
Gets the next object from the buffer without removing it.
Returns
- the next object in the buffer, which is not removed
public
abstract
Object
remove
()
Gets and removes the next object from the buffer.
Returns
- the next object in the buffer, which is also removed