public class NBest<T>
extends java.util.PriorityQueue<T>
implements java.io.Serializable
| Constructor and Description |
|---|
NBest(int limit)
constructor that takes int limit
|
NBest(int limit,
java.util.Comparator<T> comparator)
constructor that takes limit and Comparator
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(T o)
makes sure limit is not exceeded, NBest should contain the
|
T |
addRemove(T o) |
java.util.List<T> |
empty()
removes all elements and returns them in greatest to least order
|
int |
getLimit() |
clear, comparator, contains, iterator, offer, peek, poll, remove, size, toArray, toArraycontainsAll, isEmpty, removeAll, retainAll, toStringpublic NBest(int limit)
limit - public NBest(int limit,
java.util.Comparator<T> comparator)
limit - comparator -