UNPKG

663 BJavaScriptView Raw
1import { HashTable } from "../hashtable/HashTable";
2export class HashMap {
3 constructor(capacity) {
4 this.map = new HashTable(capacity);
5 }
6 get Count() {
7 return this.map.Count;
8 }
9 put(key, value) {
10 const self = this;
11 self.map.put(key, value);
12 return self;
13 }
14 get(key) {
15 return this.map.get(key);
16 }
17 clear() {
18 return this.map.clear();
19 }
20 remove(key) {
21 return this.map.remove(key);
22 }
23 keys() {
24 return this.map.getKeys();
25 }
26 values() {
27 return this.map.values();
28 }
29 contains(key) {
30 return this.map.contains(key);
31 }
32}