-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
IHashMap.ts
89 lines (82 loc) · 2.72 KB
/
IHashMap.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//================================================================
/**
* @packageDocumentation
* @module std.base
*/
//================================================================
import { MapContainer } from "./MapContainer";
import { IHashContainer } from "../../internal/container/associative/IHashContainer";
import { IPair } from "../../utility/IPair";
import { Entry } from "../../utility/Entry";
import { MapElementList } from "../../internal/container/associative/MapElementList";
/**
* Common interface for hash maps.
*
* @type Key Key type
* @type T Mapped type
* @type Unique Whether duplicated key is blocked or not
* @type Source Derived type extending this {@link IHashMap}
*
* @author Jeongho Nam - https://github.com/samchon
*/
export interface IHashMap<Key, T,
Unique extends boolean,
Source extends IHashMap<Key, T, Unique, Source>>
extends
MapContainer<Key, T,
Unique,
Source,
IHashMap.Iterator<Key, T, Unique, Source>,
IHashMap.ReverseIterator<Key, T, Unique, Source>>,
IHashContainer<Key, Entry<Key, T>, Source,
IHashMap.Iterator<Key, T, Unique, Source>,
IHashMap.ReverseIterator<Key, T, Unique, Source>,
IPair<Key, T>>
{
/* ---------------------------------------------------------
ITERATORS
--------------------------------------------------------- */
/**
* @inheritDoc
*/
begin(): IHashMap.Iterator<Key, T, Unique, Source>;
/**
* Iterator to the first element in a specific bucket.
*
* @param index Index number of the specific bucket.
* @return Iterator from the specific bucket.
*/
begin(index: number): IHashMap.Iterator<Key, T, Unique, Source>;
/**
* @inheritDoc
*/
end(): IHashMap.Iterator<Key, T, Unique, Source>;
/**
* Iterator to the end in a specific bucket.
*
* @param index Index number of the specific bucket.
* @return Iterator from the specific bucket.
*/
end(index: number): IHashMap.Iterator<Key, T, Unique, Source>;
}
export namespace IHashMap
{
/**
* Iterator of {@link IHashMap}
*
* @author Jenogho Nam <http://samchon.org>
*/
export type Iterator<Key, T,
Unique extends boolean,
Source extends IHashMap<Key, T, Unique, Source>>
= MapElementList.Iterator<Key, T, Unique, Source>;
/**
* Reverse iterator of {@link IHashMap}
*
* @author Jenogho Nam <http://samchon.org>
*/
export type ReverseIterator<Key, T,
Unique extends boolean,
Source extends IHashMap<Key, T, Unique, Source>>
= MapElementList.ReverseIterator<Key, T, Unique, Source>;
}