Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MultiMap<Key, T, Source, Iterator, Reverse>

Basic map container allowing duplicated keys.

author

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

Type parameters

  • Key

    Key type

  • T

    Mapped type

  • Source: MultiMap<Key, T, Source, Iterator, Reverse>

    Derived type extending this MultiMap

  • Iterator: Iterator<Key, T, Source, Iterator, Reverse>

  • Reverse: ReverseIterator<Key, T, Source, Iterator, Reverse>

Hierarchy

Implements

Index

Type aliases

Static InsertRet

InsertRet<Key, T, Unique, SourceT, IteratorT, Reverse>: Unique extends true ? Pair<IteratorT, boolean> : IteratorT

Return type of {@link MapContainer.insert}

Type parameters

  • Key

  • T

  • Unique: boolean

  • SourceT: MapContainer<Key, T, Unique, SourceT, IteratorT, Reverse>

  • IteratorT: Iterator<Key, T, Unique, SourceT, IteratorT, Reverse>

    Iterator type

  • Reverse: ReverseIterator<Key, T, Unique, SourceT, IteratorT, Reverse>

Static Iterator

Iterator<Key, T, Unique, SourceT, IteratorT, ReverseT>: IteratorBase<Key, T> & Readonly<Iterator<Entry<Key, T>, SourceT, IteratorT, ReverseT, IPair<Key, T>>>

Iterator of MapContainer

author

Jenogho Nam http://samchon.org

Type parameters

  • Key

  • T

  • Unique: boolean

  • SourceT: MapContainer<Key, T, Unique, SourceT, IteratorT, ReverseT>

  • IteratorT: Iterator<Key, T, Unique, SourceT, IteratorT, ReverseT>

  • ReverseT: ReverseIterator<Key, T, Unique, SourceT, IteratorT, ReverseT>

    Reverse iterator type

Static ReverseIterator

ReverseIterator<Key, T, Unique, SourceT, IteratorT, ReverseT>: IteratorBase<Key, T> & Readonly<ReverseIterator<Entry<Key, T>, SourceT, IteratorT, ReverseT, IPair<Key, T>>>

Reverse iterator of MapContainer

author

Jenogho Nam http://samchon.org

Type parameters

  • Key

  • T

  • Unique: boolean

  • SourceT: MapContainer<Key, T, Unique, SourceT, IteratorT, ReverseT>

  • IteratorT: Iterator<Key, T, Unique, SourceT, IteratorT, ReverseT>

  • ReverseT: ReverseIterator<Key, T, Unique, SourceT, IteratorT, ReverseT>

Constructors

Protected constructor

  • new MultiMap(factory: (thisArg: Source) => ILinearContainerBase<Entry<Key, T>, Source, Iterator, Reverse>): MultiMap

Methods

[Symbol.iterator]

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

assign

  • assign<InputIterator>(first: InputIterator, last: InputIterator): void

begin

  • begin(): Iterator

clear

  • clear(): void

Abstract count

  • count(key: Key): number

Abstract emplace

  • emplace(key: Key, value: T): Iterator
  • Construct and insert an element.

    Parameters

    • key: Key

      Key to be mapped.

    • value: T

      Value to emplace.

    Returns Iterator

    An iterator to the newly inserted element.

Abstract emplace_hint

  • emplace_hint(hint: Iterator, key: Key, val: T): Iterator
  • Construct and insert element with hint.

    Parameters

    • hint: Iterator

      Hint for the position where the element can be inserted.

    • key: Key

      Key of the new element.

    • val: T

      Value of the new element.

    Returns Iterator

    An iterator to the newly inserted element.

empty

  • empty(): boolean

end

  • end(): Iterator

erase

  • erase(key: Key): number
  • erase(it: Iterator): Iterator
  • erase(begin: Iterator, end: Iterator): Iterator

Abstract find

  • find(key: Key): Iterator

has

  • has(key: Key): boolean

insert

  • insert(pair: IPair<Key, T>): Iterator
  • insert(hint: Iterator, pair: IPair<Key, T>): Iterator
  • insert<InputIterator>(first: InputIterator, last: InputIterator): void
  • Insert an element.

    Parameters

    • pair: IPair<Key, T>

      A tuple to be referenced for the insert.

    Returns Iterator

    An iterator to the newly inserted element.

  • Insert an element with hint.

    Parameters

    • hint: Iterator

      Hint for the position where the element can be inserted.

    • pair: IPair<Key, T>

      A tuple to be referenced for the insert.

    Returns Iterator

    An iterator to the newly inserted element.

  • Insert range elements.

    Type parameters

    Parameters

    • first: InputIterator

      Input iterator of the first position.

    • last: InputIterator

      Input iteartor of the last position.

    Returns void

merge

  • merge(source: Source): void

push

  • push(...items: IPair<Key, T>[]): number

rbegin

  • rbegin(): Reverse

rend

  • rend(): Reverse

size

  • size(): number

Abstract swap

  • swap(obj: Source): void

toJSON

  • toJSON(): Array<Entry<Key, T>>

Generated using TypeDoc