BoundedTreeSet (Solr 3.6.2 API)
Keywords: org.apache.solr.util.BoundedTreeSet class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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>, 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 the `size()` get's bigger then `getMaxSize()`

See Also:
  Serialized Form

Constructor Summary
`BoundedTreeSet(int maxSize)`
`BoundedTreeSet(int maxSize, Collection<? extends E> c)`
`BoundedTreeSet(int maxSize, Comparator<? super E> c)`
`BoundedTreeSet(int maxSize, SortedSet<E> s)`

Method Summary
`boolean` | `add(E item)`
`boolean` | `addAll(Collection<? extends E> c)`
`int` | `getMaxSize()`
`void` | `setMaxSize(int max)`

Methods inherited from class java.util.TreeSet
`clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, remove, size, subSet, tailSet`

Methods inherited from class java.util.AbstractSet
`equals, hashCode, removeAll`

Methods inherited from class java.util.AbstractCollection
`containsAll, retainAll, toArray, toArray, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.util.Set
`containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray`

Constructor Detail

### BoundedTreeSet

    public BoundedTreeSet(int maxSize)

### BoundedTreeSet

    public BoundedTreeSet(int maxSize,
                          Collection<? extends E> c)

### BoundedTreeSet

    public BoundedTreeSet(int maxSize,
                          Comparator<? super E> c)

### BoundedTreeSet

    public BoundedTreeSet(int maxSize,
                          SortedSet<E> s)

Method Detail

### getMaxSize

    public int getMaxSize()

### setMaxSize

    public void setMaxSize(int max)

### add

    public boolean add(E item)

  Specified by:
    `add` in interface `Collection<E>`
  Specified by:
    `add` in interface `Set<E>`
  Overrides:
    `add` in class `TreeSet<E>`

### addAll

    public boolean addAll(Collection<? extends E> c)

  Specified by:
    `addAll` in interface `Collection<E>`
  Specified by:
    `addAll` in interface `Set<E>`
  Overrides:
    `addAll` in class `TreeSet<E>`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD