|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.webvm.misc.SimpleFixedSizeFIFO<T>
T - type of items contained in this history object.public final class SimpleFixedSizeFIFO<T>
A simple object that holds a fixed-size history. A fixed-size FIFO implementation.
| Constructor Summary | |
|---|---|
SimpleFixedSizeFIFO(int maxLength)
Creates new instance. |
|
| Method Summary | |
|---|---|
void |
add(T item)
Adds an item to the history, discarding oldest items when the maximum length has been reached. |
void |
clear()
Clears the history. |
T |
getNewest()
Returns the newest item put into this queue. |
List<T> |
toList()
Returns a snapshot of the FIFO. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleFixedSizeFIFO(int maxLength)
maxLength - maximum length of the FIFO queue. Old items are dropped automatically.| Method Detail |
|---|
public void add(T item)
item - the item to addpublic List<T> toList()
public void clear()
public T getNewest()
adding items only.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||