﻿// JScript File
 /********************** HashMap implementation *********************************/
HashMap = function () {
	this._dict = {};
}
HashMap.prototype.put = function put(key, value) {
	if (typeof key == "object") {
		if (!key.hasOwnProperty._id) {
			key.hasOwnProperty = function (key) {
				return Object.prototype.hasOwnProperty.call(this, key);
			}
			key.hasOwnProperty._id = this._shared.id++;
		}
		this._dict[key.hasOwnProperty._id] = value;
	} else {
		this._dict[key] = value;
	}
	return this; // for chaining
}
HashMap.prototype.remove = function remove(key) {
	delete this._dict[key];
}
HashMap.prototype.get = function get(key) {
	if (typeof key == "object") {
		return this._dict[key.hasOwnProperty._id];
	}
	return this._dict[key];
}