export class HashMap { private values: Array> = new Array(); get(key: K): V { let found = this.values.find( function(value: HashItem) { return value.key.equals(key); }); if (found) { return found.value; } return null; } put(key: K, value: V): void { this.values.push(new HashItem(key, value)); } clear() { this.values = new Array(); } } export class HashItem { key: K; value: V; constructor(key: K, value: V) { this.key = key; this.value = value; } } export abstract class EqualsObject { abstract equals(other: any): boolean; }