Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UniqueSet<Key, Source, IteratorT, ReverseT>

Basic set container blocking duplicated key.

author

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

Type parameters

  • Key

    Key type

  • Source: UniqueSet<Key, Source, IteratorT, ReverseT>

    Derived type extending this UniqueSet

  • IteratorT: Iterator<Key, Source, IteratorT, ReverseT>

    Iterator type

  • ReverseT: ReverseIterator<Key, Source, IteratorT, ReverseT>

    Reverse iterator type

Hierarchy

Implements

Index

Type aliases

Static InsertRet

InsertRet<Key, Unique, Source, IteratorT, ReverseT>: Unique extends true ? Pair<IteratorT, boolean> : IteratorT

Return type of {@link SetContainer.insert}

Type parameters

  • Key

  • Unique: boolean

  • Source: SetContainer<Key, Unique, Source, IteratorT, ReverseT>

  • IteratorT: Iterator<Key, Unique, Source, IteratorT, ReverseT>

  • ReverseT: ReverseIterator<Key, Unique, Source, IteratorT, ReverseT>

Static Iterator

Iterator<Key, Unique, SourceT, IteratorT, ReverseT>: Readonly<Iterator<Key, SourceT, IteratorT, ReverseT, Key>>

Iterator of SetContainer

author

Jenogho Nam http://samchon.org

Type parameters

  • Key

  • Unique: boolean

  • SourceT: SetContainer<Key, Unique, SourceT, IteratorT, ReverseT>

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

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

Static ReverseIterator

ReverseIterator<Key, Unique, SourceT, IteratorT, ReverseT>: Readonly<ReverseIterator<Key, SourceT, IteratorT, ReverseT, Key>>

Reverse iterator of SetContainer

author

Jenogho Nam http://samchon.org

Type parameters

  • Key

  • Unique: boolean

  • SourceT: SetContainer<Key, Unique, SourceT, IteratorT, ReverseT>

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

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

Constructors

Protected constructor

  • new UniqueSet(factory: (thisArg: Source) => ILinearContainerBase<Key, Source, IteratorT, ReverseT>): UniqueSet
  • Default Constructor.

    Parameters

    • factory: (thisArg: Source) => ILinearContainerBase<Key, Source, IteratorT, ReverseT>
        • (thisArg: Source): ILinearContainerBase<Key, Source, IteratorT, ReverseT>
        • Parameters

          • thisArg: Source

          Returns ILinearContainerBase<Key, Source, IteratorT, ReverseT>

    Returns UniqueSet

Methods

[Symbol.iterator]

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

assign

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

begin

  • begin(): IteratorT

clear

  • clear(): void

count

  • count(key: Key): number

empty

  • empty(): boolean

end

  • end(): IteratorT

erase

  • erase(key: Key): number
  • erase(pos: IteratorT): IteratorT
  • erase(first: IteratorT, last: IteratorT): IteratorT

extract

  • extract(key: Key): Key
  • extract(it: IteratorT): IteratorT

Abstract find

  • find(key: Key): IteratorT

has

  • has(key: Key): boolean

insert

  • insert(key: Key): Pair<IteratorT, boolean>
  • insert(hint: IteratorT, key: Key): IteratorT
  • insert<InputIterator>(first: InputIterator, last: InputIterator): void
  • Insert an element.

    Parameters

    • key: Key

      Key to insert.

    Returns Pair<IteratorT, boolean>

    Pair of an iterator to the newly inserted element and true, if the specified key doesn't exist, otherwise Pair of iterator to ordinary element and false.

  • Insert an element with hint.

    Parameters

    • hint: IteratorT

      Hint for the position where the element can be inserted.

    • key: Key

    Returns IteratorT

    An iterator to the newly inserted element, if the specified key doesn't exist, otherwise an iterator to the ordinary 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: Key[]): number

rbegin

  • rbegin(): ReverseT

rend

  • rend(): ReverseT

size

  • size(): number

Abstract swap

  • swap(obj: Source): void

toJSON

  • toJSON(): Array<Key>

Generated using TypeDoc