All Packages Class Hierarchy This Package Previous Next Index
Class EDU.gatech.cc.is.util.CircularBuffer
java.lang.Object
|
+----EDU.gatech.cc.is.util.CircularBuffer
- public class CircularBuffer
- extends Object
- implements Cloneable, Serializable
Implements a circular buffer for storing things.
Copyright
(c)1998 Tucker Balch
- Version:
- $Revision: 1.3 $
- Author:
- Tucker Balch
-
buf_size
- size of the buffer.
-
buffer
- the buffer itself.
-
current
- current cell in the buffer.
-
total
- total number of items ever added to the buffer.
-
CircularBuffer()
- create a CircularBuffer with default values.
-
CircularBuffer(int)
- create a CircularBuffer with a specific number of slots.
-
clear()
- clears this circular buffer.
-
elements()
- returns an enumeration of the values in this circular buffer.
-
put(Object)
- adds an item to the CircularBuffer.
buf_size
protected int buf_size
- size of the buffer. Default size is 10.
current
protected int current
- current cell in the buffer.
total
protected int total
- total number of items ever added to the buffer.
This can help reveal if data is ever lost by an enumeration.
buffer
protected Object buffer[]
- the buffer itself.
CircularBuffer
public CircularBuffer()
- create a CircularBuffer with default values.
CircularBuffer
public CircularBuffer(int s)
- create a CircularBuffer with a specific number of slots.
- Parameters:
- s - int, number of slots.
put
public synchronized void put(Object i)
- adds an item to the CircularBuffer.
- Parameters:
- i - Object, the item to add to the buffer.
clear
public void clear()
- clears this circular buffer.
elements
public Enumeration elements()
- returns an enumeration of the values in this circular buffer.
- Returns:
- the enumeration.
All Packages Class Hierarchy This Package Previous Next Index