|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.utils.RingBuffer
public class RingBuffer
INTERNAL: Utility for storing objects in a ring buffer. Adding an object may cause another one to 'fall' off if the buffer is full.
Field Summary | |
---|---|
protected java.util.ArrayList |
buffer
the buffer collection |
protected int |
maxSize
max size. |
Constructor Summary | |
---|---|
RingBuffer()
Creates a new RingBuffer with a default size of 50. |
|
RingBuffer(int maxSize)
Creates a new RingBuffer with the specified size. |
Method Summary | |
---|---|
void |
addElement(java.lang.Object obj)
Adds a new element to the buffer. |
void |
clear()
Empties the buffer. |
java.util.List |
getElements()
Returns the elements in the buffer, in order. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int maxSize
protected java.util.ArrayList buffer
Constructor Detail |
---|
public RingBuffer()
public RingBuffer(int maxSize)
Method Detail |
---|
public java.util.List getElements()
public void addElement(java.lang.Object obj)
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |