|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jamonapi.utils.NExtremeBufferHolder
public class NExtremeBufferHolder
Buffer used to keep the last N recent values based on the comparator. Note the Comparator must be thread safe.
| Constructor Summary | |
|---|---|
NExtremeBufferHolder(boolean naturalOrder)
|
|
NExtremeBufferHolder(java.util.Comparator comparator)
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object replaceWithObj)
Add the passed object to the array if BufferList is not full or shouldReplaceWith returns true |
int |
compare(java.lang.Object newObj,
java.lang.Object existingObj)
Method used by the comparator interface. |
BufferHolder |
copy()
return a usable copy of the BufferHolder |
java.util.List |
getCollection()
Get the underlying collection |
java.util.Comparator |
getComparator()
|
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(...) |
void |
setCollection(java.util.List list)
|
void |
setComparator(java.util.Comparator comparator)
|
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 |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Constructor Detail |
|---|
public NExtremeBufferHolder(java.util.Comparator comparator)
public NExtremeBufferHolder(boolean naturalOrder)
| Method Detail |
|---|
public java.util.List getCollection()
BufferHolder
getCollection in interface BufferHolderpublic void setComparator(java.util.Comparator comparator)
public java.util.Comparator getComparator()
public int compare(java.lang.Object newObj,
java.lang.Object existingObj)
compare in interface java.util.Comparatorpublic void add(java.lang.Object replaceWithObj)
BufferHolder
add in interface BufferHolderpublic void remove(java.lang.Object replaceWithObj)
BufferHolder
remove in interface BufferHolderpublic boolean shouldReplaceWith(java.lang.Object replaceWithObj)
BufferHolder
shouldReplaceWith in interface BufferHolderpublic java.util.List getOrderedCollection()
BufferHolder
getOrderedCollection in interface BufferHolderpublic void setCollection(java.util.List list)
setCollection in interface BufferHolderpublic BufferHolder copy()
BufferHolder
copy in interface BufferHolder
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||