-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
IHashSet.ts
85 lines (79 loc) · 2.54 KB
/
IHashSet.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
//================================================================
/**
* @packageDocumentation
* @module std.base
*/
//================================================================
import { SetContainer } from "./SetContainer";
import { IHashContainer } from "../../internal/container/associative/IHashContainer";
import { SetElementList } from "../../internal/container/associative/SetElementList";
/**
* Common interface for hash sets.
*
* @type Key Key type
* @type Unique Whether duplicated key is blocked or not
* @type Source Derived type extending this {@link IHashSet}
*
* @author Jeongho Nam - https://github.com/samchon
*/
export interface IHashSet<Key,
Unique extends boolean,
Source extends IHashSet<Key, Unique, Source>>
extends
SetContainer<Key,
Unique,
Source,
IHashSet.Iterator<Key, Unique, Source>,
IHashSet.ReverseIterator<Key, Unique, Source>>,
IHashContainer<Key, Key, Source,
IHashSet.Iterator<Key, Unique, Source>,
IHashSet.ReverseIterator<Key, Unique, Source>,
Key>
{
/* ---------------------------------------------------------
ITERATORS
--------------------------------------------------------- */
/**
* @inheritDoc
*/
begin(): IHashSet.Iterator<Key, 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): IHashSet.Iterator<Key, Unique, Source>;
/**
* @inheritDoc
*/
end(): IHashSet.Iterator<Key, 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): IHashSet.Iterator<Key, Unique, Source>;
}
export namespace IHashSet
{
/**
* Iterator of {@link IHashSet}
*
* @author Jenogho Nam <http://samchon.org>
*/
export type Iterator<Key,
Unique extends boolean,
Source extends IHashSet<Key, Unique, Source>>
= SetElementList.Iterator<Key, Unique, Source>;
/**
* Reverse iterator of {@link IHashSet}
*
* @author Jenogho Nam <http://samchon.org>
*/
export type ReverseIterator<Key,
Unique extends boolean,
Source extends IHashSet<Key, Unique, Source>>
= SetElementList.ReverseIterator<Key, Unique, Source>;
}