com.jamonapi.utils
Interface BufferHolder

All Known Implementing Classes:
FIFOBufferHolder, NExtremeArrayBufferHolder, NExtremeBufferHolder

public interface BufferHolder

Interface used to add/remove values from a BufferList based on whether shouldReplaceWith(...) returns true or not.


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
 

Method Detail

remove

void remove(java.lang.Object replaceWithObj)
Remove the smallest element from the BufferList if the buffer is full and shouldReplaceWith(...) returns true.

Parameters:
replaceWithObj -

add

void add(java.lang.Object replaceWithObj)
Add the passed object to the array if BufferList is not full or shouldReplaceWith returns true


shouldReplaceWith

boolean shouldReplaceWith(java.lang.Object replaceWithObj)
Returns true if this object is greater than the smallest value in the buffer


getCollection

java.util.List getCollection()
Get the underlying collection


getOrderedCollection

java.util.List getOrderedCollection()
Get the Collection in sorted order


setCollection

void setCollection(java.util.List list)

copy

BufferHolder copy()
return a usable copy of the BufferHolder