/**
* js实现的map
* Author:chenjun
* Date:2015/4/21
*/
//定义map
function Map()
{
this.container = {};
}
//将key-value放入map中
Map.prototype.put = function(key,value){
try{
if(key != null && key != "")
this.container[key] = value;
}catch(e){
return e;
}
};
//根据key从map中取出对应的value
Map.prototype.get = function(key){
try{
return this.container[key];
}catch(e){
return e;
}
};
//判断map中是否包含指定的key
Map.prototype.containsKey=function(key){
try{
for(var p in this.container)
* js实现的map
* Author:chenjun
* Date:2015/4/21
*/
//定义map
function Map()
{
this.container = {};
}
//将key-value放入map中
Map.prototype.put = function(key,value){
try{
if(key != null && key != "")
this.container[key] = value;
}catch(e){
return e;
}
};
//根据key从map中取出对应的value
Map.prototype.get = function(key){
try{
return this.container[key];
}catch(e){
return e;
}
};
//判断map中是否包含指定的key
Map.prototype.containsKey=function(key){
try{
for(var p in this.container)