|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.gatech.cc.is.util.CircularBuffer
Implements a circular buffer for storing things.
Copyright (c)2000 Tucker Balch
Field Summary | |
protected int |
buf_size
size of the buffer. |
protected java.lang.Object[] |
buffer
the buffer itself. |
protected int |
current
current cell in the buffer. |
protected int |
total
total number of items ever added to the buffer. |
Constructor Summary | |
CircularBuffer()
create a CircularBuffer with default values. |
|
CircularBuffer(int s)
create a CircularBuffer with a specific number of slots. |
Method Summary | |
void |
clear()
clears this circular buffer. |
CircularBufferEnumeration |
elements()
returns an enumeration of the values in this circular buffer. |
void |
put(java.lang.Object i)
adds an item to the CircularBuffer. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected int buf_size
protected int current
protected int total
protected java.lang.Object[] buffer
Constructor Detail |
public CircularBuffer()
public CircularBuffer(int s)
s
- int, number of slots.Method Detail |
public void put(java.lang.Object i)
i
- Object, the item to add to the buffer.public void clear()
public CircularBufferEnumeration elements()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |