Commit 4f1e59c1edc0fc35545429d963897f6a7e717a2c
1 parent
4de49a37
Exists in
master
and in
18 other branches
Removed old shared util implementations
Showing
3 changed files
with
0 additions
and
58 deletions
Show diff stats
src/app/shared/utils/arrays.ts
@@ -1,19 +0,0 @@ | @@ -1,19 +0,0 @@ | ||
1 | -export class ArrayUtils { | ||
2 | - | ||
3 | - /** | ||
4 | - * Returns if two arrays are equal | ||
5 | - */ | ||
6 | - static arraysEqual(a: any, b: any): boolean { | ||
7 | - if (a === b) return true; | ||
8 | - if (a == null || b == null) return false; | ||
9 | - if (a.length !== b.length) return false; | ||
10 | - | ||
11 | - // If you don't care about the order of the elements inside | ||
12 | - // the array, you should sort both arrays here. | ||
13 | - for (let i = 0; i < a.length; ++i) { | ||
14 | - if (a[i] !== b[i]) return false; | ||
15 | - } | ||
16 | - return true; | ||
17 | - } | ||
18 | - | ||
19 | -} | ||
20 | \ No newline at end of file | 0 | \ No newline at end of file |
src/app/shared/utils/hashmap.ts
@@ -1,36 +0,0 @@ | @@ -1,36 +0,0 @@ | ||
1 | -export class HashMap<K extends EqualsObject, V> { | ||
2 | - private values: Array<HashItem<K, V>> = new Array(); | ||
3 | - | ||
4 | - get(key: K): V { | ||
5 | - let found = this.values.find( function(value: HashItem<K, V>) { | ||
6 | - return value.key.equals(key); | ||
7 | - }); | ||
8 | - if (found) { | ||
9 | - return found.value; | ||
10 | - } | ||
11 | - return null; | ||
12 | - } | ||
13 | - | ||
14 | - put(key: K, value: V): void { | ||
15 | - this.values.push(new HashItem(key, value)); | ||
16 | - } | ||
17 | - | ||
18 | - clear() { | ||
19 | - this.values = new Array(); | ||
20 | - } | ||
21 | -} | ||
22 | - | ||
23 | -export class HashItem<K, V> { | ||
24 | - key: K; | ||
25 | - value: V; | ||
26 | - constructor(key: K, value: V) { | ||
27 | - this.key = key; | ||
28 | - this.value = value; | ||
29 | - } | ||
30 | -} | ||
31 | - | ||
32 | -export abstract class EqualsObject { | ||
33 | - | ||
34 | - abstract equals(other: any): boolean; | ||
35 | - | ||
36 | -} | ||
37 | \ No newline at end of file | 0 | \ No newline at end of file |
src/app/shared/utils/index.ts