public class NExtremeBufferHolder extends java.lang.Object implements BufferHolder, java.util.Comparator
| Constructor and Description |
|---|
NExtremeBufferHolder(boolean naturalOrder) |
NExtremeBufferHolder(java.util.Comparator comparator) |
| Modifier and Type | Method and Description |
|---|---|
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(...)
returns true.
|
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
|
public NExtremeBufferHolder(java.util.Comparator comparator)
public NExtremeBufferHolder(boolean naturalOrder)
public java.util.List getCollection()
BufferHoldergetCollection 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)
BufferHolderadd in interface BufferHolderpublic void remove(java.lang.Object replaceWithObj)
BufferHolderremove in interface BufferHolderpublic boolean shouldReplaceWith(java.lang.Object replaceWithObj)
BufferHoldershouldReplaceWith in interface BufferHolderpublic java.util.List getOrderedCollection()
BufferHoldergetOrderedCollection in interface BufferHolderpublic void setCollection(java.util.List list)
setCollection in interface BufferHolderpublic BufferHolder copy()
BufferHoldercopy in interface BufferHolder