function Struct (_key, _value)
{
	this.key	= _key;
	this.value	= _value;
	
	this.toString = function ()
	{
		return this.key;
	}
}

function HashMap ()
{
	this.map = new Array();
	
	this.get = function (key)
	{
		for (var i = 0; i < this.map.length; i++)
		{
			if ( this.map[i].key == key )
				return this.map[i].value;
		}
		
		return null;
	}
	
	this.getKey = function (index)
	{
		if (this.map.length <= index)
			return null;
		
		return this.map[index].key;
	}
	
	this.getValue = function (index)
	{
		if (this.map.length <= index)
			return null;
		
		return this.map[index].value;
	}
	
	this.put = function (key, value)
	{
		for (var i = 0; i < this.map.length; i++)
		{
			if ( this.map[i].key == key )
			{
				this.map[i].value = value;
				return;
			}
		}
		
		this.map [this.map.length] = new Struct(key, value);
	}
	
	this.remove = function (key)
	{
		var v;
		
		for (var i = this.map.length - 1; i >= 0; i--)
		{
			v = this.map.pop();
			
			if ( v.key == key )
				continue;
			
			this.map.unshift(v);
		}
	}
	
	this.getLastValue = function ()
	{
		return this.map[this.map.length-1].value;
	}
	
	this.size = function ()
	{
		return this.map.length;
	}

	this.isEmpty = function ()
	{
		return (this.map.length == 0);
	}
	
	this.getKeys = function ()
	{
		var size = this.size ();
		
		if (size == 0)
			return null;
		
		var keys = new Array (size);
		
		for (var i = 0; i < size; i++)
			keys[i] = this.map [i].key;
		
		return keys;
	}
	
	this.getValues = function ()
	{
		var size = this.size ();
		
		if (size == 0)
			return null;
		
		var values = new Array (size);
		
		for (var i = 0; i < size; i++)
			values[i] = this.map [i].value;
		
		return values;
	}
	
	this.clear = function ()
	{
		for (var i = this.map.length - 1; i >= 0; i--)
		{
			v = this.map.pop();
		}
	}
}