public class BoundedTreeSet<E>
extends java.util.TreeSet<E>
last() is removed if the size()
get's bigger then getMaxSize()| Modifier and Type | Field and Description |
|---|---|
private int |
maxSize |
| Constructor and Description |
|---|
BoundedTreeSet(int maxSize) |
BoundedTreeSet(int maxSize,
java.util.Collection<? extends E> c) |
BoundedTreeSet(int maxSize,
java.util.Comparator<? super E> c) |
BoundedTreeSet(int maxSize,
java.util.SortedSet<E> s) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E item) |
boolean |
addAll(java.util.Collection<? extends E> c) |
private void |
adjust() |
int |
getMaxSize() |
void |
setMaxSize(int max) |
ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSetcontainsAll, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitpublic BoundedTreeSet(int maxSize)
public BoundedTreeSet(int maxSize,
java.util.Collection<? extends E> c)
public BoundedTreeSet(int maxSize,
java.util.Comparator<? super E> c)
public BoundedTreeSet(int maxSize,
java.util.SortedSet<E> s)
public int getMaxSize()
public void setMaxSize(int max)
private void adjust()
public boolean add(E item)