01: package com.jamonapi.utils;
02:
03: import java.util.*;
04:
05: /** Interface used to add/remove values from a BufferList based on whether shouldReplaceWith(...)
06: * returns true or not.
07: * @author steve souza
08: *
09: */
10: public interface BufferHolder {
11: /** Remove the smallest element from the BufferList if the buffer is full and shouldReplaceWith(...)
12: * returns true.
13: * @param replaceWithObj
14: */
15: public void remove(Object replaceWithObj);
16:
17: /** Add the passed object to the array if BufferList is not full or shouldReplaceWith returns true*/
18: public void add(Object replaceWithObj);
19:
20: /** Returns true if this object is greater than the smallest value in the buffer */
21: public boolean shouldReplaceWith(Object replaceWithObj);
22:
23: /** Get the underlying collection */
24: public List getCollection();
25:
26: /** Get the Collection in sorted order */
27: public List getOrderedCollection();
28:
29: public void setCollection(List list);
30:
31: /** return a usable copy of the BufferHolder */
32: public BufferHolder copy();
33:
34: }
|