Package org.apache.solr.util
Class BoundedTreeSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.TreeSet<E>
org.apache.solr.util.BoundedTreeSet<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,NavigableSet<E>,SequencedCollection<E>,SequencedSet<E>,Set<E>,SortedSet<E>
A TreeSet that ensures it never grows beyond a max size.
last() is removed if the
size() get's bigger then getMaxSize()- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBoundedTreeSet(int maxSize) BoundedTreeSet(int maxSize, Collection<? extends E> c) BoundedTreeSet(int maxSize, Comparator<? super E> c) BoundedTreeSet(int maxSize, SortedSet<E> s) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> c) intvoidsetMaxSize(int max) Methods inherited from class java.util.TreeSet
addFirst, addLast, ceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSetMethods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.NavigableSet
removeFirst, removeLast, reversed
-
Constructor Details
-
BoundedTreeSet
public BoundedTreeSet(int maxSize) -
BoundedTreeSet
-
BoundedTreeSet
-
BoundedTreeSet
-
-
Method Details
-
getMaxSize
public int getMaxSize() -
setMaxSize
public void setMaxSize(int max) -
add
-
addAll
-