function struct(key, value){

  this.key = key;
  this.value = value;

}

function setAt(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);

}

function lookUp(key)
{
  for (var i = 0; i < this.map.length; i++)
  {
    if ( this.map[i].key === key )
    {
      return this.map[i].value;
    }
  }
  
  return null;
}

function getKey(key)
{
  if  ( key < this.map.length){
	  return this.map[key].key;
  }else{
	  return null;	  
  }
}
function getvalue(key)
{
  if  ( key < this.map.length){
	  return this.map[key].value;
  }else{
	  return null;	  
  }
}


function removeKey(key)
{
  var v;
  for (var i = 0; i < this.map.length; i++)
  {
    v = this.map.pop();
    if ( v.key === key )
      continue;
      
    this.map.unshift(v);
  }
}

function getCount(){
  return this.map.length;
}

function isEmpty(){
  return this.map.length <= 0;
}

function classMap() {

  this.map = new Array();

  this.lookUp = lookUp;
  this.setAt = setAt;
  this.getKey = getKey;
  this.getvalue = getvalue;
  this.removeKey = removeKey;
  this.getCount = getCount;
  this.isEmpty = isEmpty;
}
