edu.wpi.first.wpilibj.util

## Class SortedVector<E>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<E>
    - - java.util.Vector<E>
      - - edu.wpi.first.wpilibj.util.SortedVector<E>

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess

      public class SortedVector<E>
      extends java.util.Vector<E>

  A vector that is sorted.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `SortedVector.Comparator` Interface used to determine the order to place sorted objects.

  - ### Field Summary

    - ### Fields inherited from class java.util.Vector

      `capacityIncrement, elementCount, elementData`

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SortedVector(SortedVector.Comparator comparator)` Create a new sorted vector and use the given comparator to determine order.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addElement(E element)` Adds an element in the Vector, sorted from greatest to least.
    `void` | `sort()` Sort the vector.

    - ### Methods inherited from class java.util.Vector

      `add, add, addAll, addAll, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, stream`

- - ### Constructor Detail

    - #### SortedVector

          public SortedVector(SortedVector.Comparator comparator)

      Create a new sorted vector and use the given comparator to determine order.
      Parameters:
        `comparator` - The comparator to use to determine what order to place the elements in this vector.

  - ### Method Detail

    - #### addElement

          public void addElement(E element)

      Adds an element in the Vector, sorted from greatest to least.
      Overrides:
        `addElement` in class `java.util.Vector<E>`
      Parameters:
        `element` - The element to add to the Vector

    - #### sort

          public void sort()

      Sort the vector.