|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmce.util.RingBuffer<E>
public class RingBuffer<E>
Constructor Summary | |
---|---|
RingBuffer()
Default constructor. |
|
RingBuffer(int size)
Constructor with specified the size |
Method Summary | |
---|---|
boolean |
contains(java.lang.Object o)
Check if the specified element exist in the queue |
int |
count()
Return the number of element in the buffer. |
E |
get()
Return the first element from the buffer and advance the pointer to the next one |
int |
getSize()
Return the size of the buffer. |
boolean |
isEmpty()
Return true if the buffer is empty. |
boolean |
isFull()
Return true if the buffer is full. |
E |
peek()
Return the first element in the buffer without advancing the pointer. |
void |
purge()
Remove all element from the buffer. |
boolean |
put(E o)
Add a new element to the buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RingBuffer(int size)
public RingBuffer()
A new RingBuffer will be created with the default size of 256 element.
Method Detail |
---|
public final void purge()
public final E peek()
public final E get()
public final int count()
public final boolean put(E o)
public final boolean isEmpty()
public final boolean isFull()
public final int getSize()
public final boolean contains(java.lang.Object o)
o
- - Element to check.
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |