|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jamonapi.utils.FIFOBufferHolder
public class FIFOBufferHolder
First-in, first-out buffer. When the BufferList is filled the first element is removed to make room for the newest value, then the second oldest etc. Used in BufferList and subsequently JAMonBufferListeners.
Constructor Summary | |
---|---|
FIFOBufferHolder()
|
Method Summary | |
---|---|
void |
add(java.lang.Object replaceWithObj)
Add the passed object to the array if BufferList is not full or shouldReplaceWith returns true |
BufferHolder |
copy()
return a usable copy of the BufferHolder |
java.util.List |
getCollection()
Get the underlying collection |
java.util.List |
getOrderedCollection()
Get the Collection in sorted order |
void |
remove(java.lang.Object replaceWithObj)
Remove the smallest element from the BufferList if the buffer is full and shouldReplaceWith(...) returns true. |
void |
setCollection(java.util.List list)
|
boolean |
shouldReplaceWith(java.lang.Object replaceWithObj)
Returns true if this object is greater than the smallest value in the buffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FIFOBufferHolder()
Method Detail |
---|
public void add(java.lang.Object replaceWithObj)
BufferHolder
add
in interface BufferHolder
public void remove(java.lang.Object replaceWithObj)
BufferHolder
remove
in interface BufferHolder
public boolean shouldReplaceWith(java.lang.Object replaceWithObj)
BufferHolder
shouldReplaceWith
in interface BufferHolder
public java.util.List getCollection()
BufferHolder
getCollection
in interface BufferHolder
public java.util.List getOrderedCollection()
BufferHolder
getOrderedCollection
in interface BufferHolder
public void setCollection(java.util.List list)
setCollection
in interface BufferHolder
public BufferHolder copy()
BufferHolder
copy
in interface BufferHolder
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |