org.apache.avalon.excalibur.collections
Class VariableSizeBuffer

java.lang.Object
  |
  +--org.apache.avalon.excalibur.collections.VariableSizeBuffer
All Implemented Interfaces:
Buffer

Deprecated. use org.apache.commons.collections.UnboundedFifoBuffer instead

public final class VariableSizeBuffer
extends Object
implements Buffer

VariableSizeBuffer 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.

Since:
4.0
Version:
CVS $Revision: 1.4 $ $Date: 2003/03/22 12:46:22 $
Author:
Federico Barbieri, Berin Loritsch

Field Summary
protected  Object[] m_buffer
          Deprecated.  
protected  int m_head
          Deprecated.  
protected  int m_tail
          Deprecated.  
 
Constructor Summary
VariableSizeBuffer()
          Deprecated. Initialize the VariableSizeBuffer with the default number of elements.
VariableSizeBuffer(int size)
          Deprecated. Initialize the VariableSizeBuffer with the specified number of elements.
 
Method Summary
 void add(Object o)
          Deprecated. Add an object into the buffer
 boolean isEmpty()
          Deprecated. Tests to see if the CircularBuffer is empty.
 Object remove()
          Deprecated. Removes the next object from the buffer
 int size()
          Deprecated. Returns the number of elements stored in the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_buffer

protected Object[] m_buffer
Deprecated. 

m_head

protected int m_head
Deprecated. 

m_tail

protected int m_tail
Deprecated. 
Constructor Detail

VariableSizeBuffer

public VariableSizeBuffer(int size)
Deprecated. 
Initialize the VariableSizeBuffer with the specified number of elements. The integer must be a positive integer.


VariableSizeBuffer

public VariableSizeBuffer()
Deprecated. 
Initialize the VariableSizeBuffer with the default number of elements. It is exactly the same as performing the following:
   new VariableSizeBuffer( 32 );
 

Method Detail

isEmpty

public final boolean isEmpty()
Deprecated. 
Tests to see if the CircularBuffer is empty.

Specified by:
isEmpty in interface Buffer

size

public final int size()
Deprecated. 
Returns the number of elements stored in the buffer.

Specified by:
size in interface Buffer

add

public final void add(Object o)
Deprecated. 
Add an object into the buffer

Specified by:
add in interface Buffer

remove

public Object remove()
Deprecated. 
Removes the next object from the buffer

Specified by:
remove in interface Buffer


Copyright © 2000-2003 Apache Jakarta Project. All Rights Reserved.