Package generic.stl

# Class VectorSTL<T>

java.lang.Object
generic.stl.VectorSTL<T>

All Implemented Interfaces:
  `Iterable<T>`

public class VectorSTL<T> extends Object implements Iterable<T>

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VectorSTL()`
  `VectorSTL(int initialCapacity)`
  `VectorSTL(int initialCapacity, T value)`
  `VectorSTL(VectorSTL<T> other)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `appendAll(VectorSTL<T> vector)`
  `void`
  `assign(VectorSTL<T> otherVector)`
  `T`
  `back()`
  `IteratorSTL<T>`
  `begin()`
  `void`
  `clear()`
  `VectorSTL<T>`
  `copy()`
  `boolean`
  `empty()`
  `IteratorSTL<T>`
  `end()`
  `boolean`
  `equals(Object obj)`
  `T`
  `erase(int index)`
  `IteratorSTL<T>`
  `erase(IteratorSTL<T> it)`
  `void`
  `erase(IteratorSTL<T> start, IteratorSTL<T> end)`
  `T`
  `front()`
  `T`
  `get(int index)`
  `void`
  `insert(int index, T value)`
  `void`
  `insert(IteratorSTL<T> iterator, T value)`
  `void`
  `insert(IteratorSTL<T> pos, T[] list)`
  `void`
  `insertAll(IteratorSTL<T> pos, VectorSTL<T> vector)`
  `Iterator<T>`
  `iterator()`
  `IteratorSTL<T>`
  `lower_bound(T key)`
  Returns an iterator postioned at the item in the vector that is the smallest key less or equal than the given key.
  `IteratorSTL<T>`
  `lower_bound(T key, Comparator<T> comparator)`
  Returns an iterator postioned at the item in the vector that is the smallest key less or equal than the given key.
  `static <K> void`
  `merge(VectorSTL<K> v1, VectorSTL<K> v2, VectorSTL<K> destination)`
  `static <K> void`
  `merge(VectorSTL<K> v1, VectorSTL<K> v2, VectorSTL<K> destination, Comparator<K> comparator)`
  `T`
  `pop_back()`
  `void`
  `push_back(T value)`
  `IteratorSTL<T>`
  `rBegin()`
  `IteratorSTL<T>`
  `rEnd()`
  `void`
  `reserve(int capacity)`
  `void`
  `resize(int size, T value)`
  `void`
  `set(int index, T value)`
  `void`
  `set(IteratorSTL<T> iter, T value)`
  `void`
  `setBack(T value)`
  `int`
  `size()`
  `void`
  `sort()`
  Sorts the vector.
  `void`
  `sort(Comparator<T> comparator)`
  `String`
  `toString()`
  `IteratorSTL<T>`
  `upper_bound(T key)`
  Returns an iterator postioned at the item in the vector that is the smallest key less than the given key.
  `IteratorSTL<T>`
  `upper_bound(T key, Comparator<T> comparator)`
  Returns an iterator postioned at the item in the vector that is the smallest key less than the given key.

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

  `clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### VectorSTL

    public VectorSTL()

  - ### VectorSTL

    public VectorSTL(int initialCapacity)

  - ### VectorSTL

    public VectorSTL(int initialCapacity, T value)

  - ### VectorSTL

    public VectorSTL(VectorSTL<T> other)

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### reserve

    public void reserve(int capacity)

  - ### begin

    public IteratorSTL<T> begin()

  - ### end

    public IteratorSTL<T> end()

  - ### rBegin

    public IteratorSTL<T> rBegin()

  - ### rEnd

    public IteratorSTL<T> rEnd()

  - ### clear

    public void clear()

  - ### size

    public int size()

  - ### empty

    public boolean empty()

  - ### get

    public T get(int index)

  - ### front

    public T front()

  - ### back

    public T back()

  - ### setBack

    public void setBack(T value)

  - ### push_back

    public void push_back(T value)

  - ### pop_back

    public T pop_back()

  - ### insert

    public void insert(int index, T value)

  - ### appendAll

    public void appendAll(VectorSTL<T> vector)

  - ### insertAll

    public void insertAll(IteratorSTL<T> pos, VectorSTL<T> vector)

  - ### insert

    public void insert(IteratorSTL<T> iterator, T value)

  - ### set

    public void set(int index, T value)

  - ### set

    public void set(IteratorSTL<T> iter, T value)

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### erase

    public T erase(int index)

  - ### erase

    public IteratorSTL<T> erase(IteratorSTL<T> it)

  - ### erase

    public void erase(IteratorSTL<T> start, IteratorSTL<T> end)

  - ### sort

    public void sort()
    Sorts the vector. To use this method T must be comparable.
    Throws:
      `UnsupportedOperationException` - if T is not comparable;

  - ### sort

    public void sort(Comparator<T> comparator)

  - ### copy

    public VectorSTL<T> copy()

  - ### iterator

    public Iterator<T> iterator()
    Specified by:
      `iterator` in interface `Iterable<T>`

  - ### lower_bound

    public IteratorSTL<T> lower_bound(T key, Comparator<T> comparator)
    Returns an iterator postioned at the item in the vector that is the smallest key less or equal than the given key. This method assumes the vector is sorted in ascending order.
    Parameters:
      `key` - the key for which to find the lower bound
    Returns:
      an iterator postioned at the item in the vector that is the smallest key less or equal than the given key.
    Throws:
      `UnsupportedOperationException` - if T is not comparable

  - ### lower_bound

    public IteratorSTL<T> lower_bound(T key)
    Returns an iterator postioned at the item in the vector that is the smallest key less or equal than the given key. This method assumes the vector is sorted in ascending order.
    Parameters:
      `key` - the key for which to find the lower bound
    Returns:
      an iterator postioned at the item in the vector that is the smallest key less or equal than the given key.

  - ### upper_bound

    public IteratorSTL<T> upper_bound(T key)
    Returns an iterator postioned at the item in the vector that is the smallest key less than the given key. This method assumes the vector is sorted in ascending order.
    Parameters:
      `key` - the key for which to find the upper bound
    Returns:
      an iterator postioned at the item in the vector that is the smallest key less than the given key.
    Throws:
      `UnsupportedOperationException` - if T is not comparable

  - ### upper_bound

    public IteratorSTL<T> upper_bound(T key, Comparator<T> comparator)
    Returns an iterator postioned at the item in the vector that is the smallest key less than the given key. This method assumes the vector is sorted in ascending order.
    Parameters:
      `key` - the key for which to find the upper bound
    Returns:
      an iterator postioned at the item in the vector that is the smallest key less than the given key.
    Throws:
      `UnsupportedOperationException` - if T is not comparable

  - ### merge

    public static <K> void merge(VectorSTL<K> v1, VectorSTL<K> v2, VectorSTL<K> destination)

  - ### merge

    public static <K> void merge(VectorSTL<K> v1, VectorSTL<K> v2, VectorSTL<K> destination, Comparator<K> comparator)

  - ### resize

    public void resize(int size, T value)

  - ### insert

    public void insert(IteratorSTL<T> pos, T[] list)

  - ### assign

    public void assign(VectorSTL<T> otherVector)