org.apache.avalon.excalibur.collections
Class FixedSizeBuffer

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

public final class FixedSizeBuffer
extends java.lang.Object
implements Buffer

The FixedSizeBuffer is a very efficient implementation of Buffer that does not alter the size of the buffer at runtime.

Author:
Berin Loritsch

Constructor Summary
FixedSizeBuffer()
           
FixedSizeBuffer(int size)
           
 
Method Summary
 void add(java.lang.Object element)
          Add an object into the buffer.
 boolean isEmpty()
          Tests to see if the CircularBuffer is empty.
 java.lang.Object remove()
          Removes the next object from the buffer.
 int size()
          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
 

Constructor Detail

FixedSizeBuffer

public FixedSizeBuffer(int size)

FixedSizeBuffer

public FixedSizeBuffer()
Method Detail

size

public final int size()
Description copied from interface: Buffer
Returns the number of elements stored in the buffer.
Specified by:
size in interface Buffer

isEmpty

public final boolean isEmpty()
Description copied from interface: Buffer
Tests to see if the CircularBuffer is empty.
Specified by:
isEmpty in interface Buffer

add

public final void add(java.lang.Object element)
Description copied from interface: Buffer
Add an object into the buffer.
Specified by:
add in interface Buffer
Following copied from interface: org.apache.avalon.excalibur.collections.Buffer
Throws:
BufferOverflowException - if adding this element exceeds the buffer's capacity.

remove

public final java.lang.Object remove()
Description copied from interface: Buffer
Removes the next object from the buffer.
Specified by:
remove in interface Buffer
Following copied from interface: org.apache.avalon.excalibur.collections.Buffer
Throws:
BufferUnderflowException - if the buffer is already empty


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.