Added HashMap definition.

This commit is contained in:
Rafał Wrzeszcz
2014-07-25 14:24:05 +02:00
parent bd21e85b3b
commit 1f96102ae3
3 changed files with 96 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
/// <reference path="hashmap.d.ts"/>
var map : HashMap<string, number> = new HashMap<string, number>();
map.set("foo", 123);
var value : number = map.get("foo");
map.has("foo");
map.remove("foo");
var keys : string[] = map.keys();
var values : number[] = map.values();
var count : number = map.count();
map.forEach(function(value : number, key : string) : void {
console.log(key);
console.log(value);
});
map.clear();