/** * @packageDocumentation * @module std.base */ import { IAssociativeContainer } from "../../internal/container/associative/IAssociativeContainer"; import { IContainer } from "./IContainer"; import { Container } from "./Container"; import { IForwardIterator } from "../../iterator/IForwardIterator"; import { ILinearContainerBase } from "../../internal/container/linear/ILinearContainerBase"; import { IPair } from "../../utility/IPair"; import { Entry } from "../../utility/Entry"; import { Pair } from "../../utility/Pair"; /** * Basic map container. * * @template Key Key type * @template T Mapped type * @template Unique Whether duplicated key is blocked or not * @template Source Derived type extending this {@link MapContainer} * @template IteratorT Iterator type * @template ReverseT Reverse iterator type * * @author Jeongho Nam - https://github.com/samchon */ export declare abstract class MapContainer, IteratorT extends MapContainer.Iterator, ReverseT extends MapContainer.ReverseIterator> extends Container, Source, IteratorT, ReverseT, IPair> implements IAssociativeContainer, Source, IteratorT, ReverseT, IPair> { protected data_: ILinearContainerBase, Source, IteratorT, ReverseT>; /** * Default Constructor. */ protected constructor(factory: (thisArg: Source) => ILinearContainerBase, Source, IteratorT, ReverseT>); /** * @inheritDoc */ assign, InputIterator>>>(first: InputIterator, last: InputIterator): void; /** * @inheritDoc */ clear(): void; /** * @inheritDoc */ abstract find(key: Key): IteratorT; /** * @inheritDoc */ begin(): IteratorT; /** * @inheritDoc */ end(): IteratorT; /** * @inheritDoc */ has(key: Key): boolean; /** * @inheritDoc */ abstract count(key: Key): number; /** * @inheritDoc */ size(): number; /** * @inheritDoc */ push(...items: IPair[]): number; abstract emplace(key: Key, val: T): MapContainer.InsertRet; abstract emplace_hint(hint: IteratorT, key: Key, val: T): IteratorT; insert(pair: IPair): MapContainer.InsertRet; insert(hint: IteratorT, pair: IPair): IteratorT; insert, InputIterator>>>(first: InputIterator, last: InputIterator): void; protected abstract _Insert_by_range, InputIterator>>>(first: InputIterator, last: InputIterator): void; /** * @inheritDoc */ erase(key: Key): number; /** * @inheritDoc */ erase(it: IteratorT): IteratorT; /** * @inheritDoc */ erase(begin: IteratorT, end: IteratorT): IteratorT; protected abstract _Erase_by_key(key: Key): number; protected _Erase_by_range(first: IteratorT, last?: IteratorT): IteratorT; /** * @inheritDoc */ abstract swap(obj: Source): void; /** * Merge two containers. * * @param source Source container to transfer. */ abstract merge(source: Source): void; protected abstract _Handle_insert(first: IteratorT, last: IteratorT): void; protected abstract _Handle_erase(first: IteratorT, last: IteratorT): void; } /** * */ export declare namespace MapContainer { /** * Return type of {@link MapContainer.insert} */ export type InsertRet, IteratorT extends Iterator, Reverse extends ReverseIterator> = Unique extends true ? Pair : IteratorT; /** * Iterator of {@link MapContainer} * * @author Jenogho Nam */ export type Iterator, IteratorT extends Iterator, ReverseT extends ReverseIterator> = IteratorBase & Readonly, SourceT, IteratorT, ReverseT, IPair>>; /** * Reverse iterator of {@link MapContainer} * * @author Jenogho Nam */ export type ReverseIterator, IteratorT extends Iterator, ReverseT extends ReverseIterator> = IteratorBase & Readonly, SourceT, IteratorT, ReverseT, IPair>>; interface IteratorBase { /** * The first, key element. */ readonly first: Key; /** * The second, stored element. */ second: T; } export {}; } //# sourceMappingURL=MapContainer.d.ts.map