|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.common.patterns.order.RingBuffer<T>
public class RingBuffer<T>
This class defines a simple RingBuffer.
| Nested Class Summary | |
|---|---|
class |
RingBuffer.RingBufferIterator<E>
This class defines a RingBufferIterator |
| Constructor Summary | |
|---|---|
RingBuffer(int capacity)
|
|
| Method Summary | |
|---|---|
void |
add(T newElement)
Add an element to the buffer. |
void |
addAll(RingBuffer<T> ringBuffer)
|
RingBuffer<T> |
clone()
Get a synchronized copy of the elements in this buffer. |
int |
getCapacity()
Get the maximum capacity of the buffer. |
int |
getElementCount()
Get the total number of elements in the buffer. |
java.util.ArrayList<T> |
getElements()
|
int |
getLastElement()
|
int |
getnextElementIndex()
Returns the nextElementIndex value. |
java.util.Iterator<T> |
iterator()
Let's be iterable! |
static void |
main(java.lang.String[] argv)
Quick and dirty unit test for this class. |
void |
setNextElementIndex(int nextElementIndex)
|
java.lang.String |
toString()
Formats a string with elements counted and delimited by a simple text header. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RingBuffer(int capacity)
| Method Detail |
|---|
public void add(T newElement)
newElement - public void setNextElementIndex(int nextElementIndex)
public void addAll(RingBuffer<T> ringBuffer)
public java.util.ArrayList<T> getElements()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public int getElementCount()
public int getCapacity()
public RingBuffer<T> clone()
clone in class java.lang.Objectpublic int getnextElementIndex()
public int getLastElement()
public static void main(java.lang.String[] argv)
argv - public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>Iterable.iterator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||