-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmap.h
69 lines (50 loc) · 1.32 KB
/
map.h
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
// A1: Part 2
// lang: CwC
#pragma once
#include "object.h"
class Map: public Object {
public:
Map() {
// Constructor for Map
}
~Map() {
// Destructor for Map
}
// Returns the amount of entries in this map
size_t length();
// Removes all entries in this map
void clear();
// Gets the value at a specific key
Object* get(Object* key);
// Sets the value at the specified key to the value
void set(Object* key, Object* value);
// Removes value at the specified key and returns the removed object
Object* remove(Object* key);
// Gets all the keys of this map
Object** getKeys();
// Gets all the values of this map
Object** getValues();
// Checks if this map is equal to another object
bool equals(Object* o);
// Returns the hash of this map
size_t hash();
};
class StringMap: public Map {
public:
StringMap() {
// Constructor for StringMap
}
~StringMap() {
// Destructor for StringMap
}
// Gets the value at a specific key
String* get(String* key);
// Sets the value at the specified key to the value
void set(String* key, String* value);
// Removes value at the specified key and returns the removed object
String* remove(String* key);
// Gets all the keys of this map
String** getKeys();
// Gets all the values of this map
String** getValues();
};