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()
BufferHolder
getCollection
in interface BufferHolder
public 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.Comparator
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 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