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>,- Set<E>,- SortedSet<E>
 
 public class BoundedTreeSet<E> extends TreeSet<E> A TreeSet that ensures it never grows beyond a max size.last()is removed if thesize()get's bigger thengetMaxSize()- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description BoundedTreeSet(int maxSize)BoundedTreeSet(int maxSize, Collection<? extends E> c)BoundedTreeSet(int maxSize, Comparator<? super E> c)BoundedTreeSet(int maxSize, SortedSet<E> s)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E item)booleanaddAll(Collection<? extends E> c)intgetMaxSize()voidsetMaxSize(int max)- 
Methods inherited from class java.util.TreeSetceiling, clear, clone, comparator, contains, descendingIterator, descendingSet, first, floor, headSet, headSet, higher, isEmpty, iterator, last, lower, pollFirst, pollLast, remove, size, spliterator, subSet, subSet, tailSet, tailSet
 - 
Methods inherited from class java.util.AbstractSetequals, hashCode, removeAll
 - 
Methods inherited from class java.util.AbstractCollectioncontainsAll, retainAll, toArray, toArray, toString
 - 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArray
 
- 
 
- 
- 
- 
Constructor Detail- 
BoundedTreeSetpublic BoundedTreeSet(int maxSize) 
 - 
BoundedTreeSetpublic BoundedTreeSet(int maxSize, Collection<? extends E> c)
 - 
BoundedTreeSetpublic BoundedTreeSet(int maxSize, Comparator<? super E> c)
 
- 
 - 
Method Detail- 
getMaxSizepublic int getMaxSize() 
 - 
setMaxSizepublic void setMaxSize(int max) 
 - 
addpublic boolean add(E item) 
 
- 
 
-