Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Vector<T>

Vector, an array with variable capacity.

author

Jeongho Nam - https://github.com/samchon

Type parameters

  • T

Hierarchy

  • VectorContainer<T, Vector<T>, Vector<T>, Vector.Iterator<T>, Vector.ReverseIterator<T>>
    • Vector

Implements

  • IContainer<T, Vector<T>, Vector.Iterator<T>, Vector.ReverseIterator<T>, T>
  • ILinearContainerBase<T, Vector<T>, Vector.Iterator<T>, Vector.ReverseIterator<T>, T>
  • IArrayContainer<T, Vector<T>, Vector.Iterator<T>, Vector.ReverseIterator<T>>

Index

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<T>

assign

  • assign(n: number, val: T): void
  • assign<InputIterator>(begin: InputIterator, end: InputIterator): void

at

  • at(index: number): T

back

  • back(): T
  • back(val: T): void

begin

  • begin(): Vector.Iterator<T>

clear

  • clear(): void

data

  • data(): Array<T>

empty

  • empty(): boolean

end

  • end(): Vector.Iterator<T>

equals

  • equals(obj: Vector<T>): boolean

erase

  • erase(it: Vector.Iterator<T>): Vector.Iterator<T>
  • erase(first: Vector.Iterator<T>, last: Vector.Iterator<T>): Vector.Iterator<T>

front

  • front(): T
  • front(val: T): void

insert

  • insert(pos: Vector.Iterator<T>, val: T): Vector.Iterator<T>
  • insert(pos: Vector.Iterator<T>, n: number, val: T): Vector.Iterator<T>
  • insert<InputIterator>(pos: Vector.Iterator<T>, first: InputIterator, last: InputIterator): Vector.Iterator<T>

nth

  • nth(index: number): Vector.Iterator<T>

pop_back

  • pop_back(): void

push

  • push(...items: T[]): number

push_back

  • push_back(val: T): void

rbegin

  • rbegin(): Vector.ReverseIterator<T>

rend

  • rend(): Vector.ReverseIterator<T>

resize

  • resize(n: number): void

set

  • set(index: number, val: T): void

size

  • size(): number

swap

toJSON

  • toJSON(): Array<T>

Static wrap

  • wrap<T>(data: Array<T>): Vector<T>
  • Wrap an array into a vector.

    Type parameters

    • T

    Parameters

    • data: Array<T>

      Target array to be wrapped

    Returns Vector<T>

    A vector wrapping the parametric array.

Generated using TypeDoc