function Hashtable()
{
this._hash = new Object();
this.add = function(key,value){
if(typeof(key)!="undefined"){
if(this.contains(key)==false){
this._hash[key]=typeof(value)=="undefined"?null:value;
return true;
}
else {
return false;
}
}
else {
return false;
}
}
this.remove = function(key){
delete this._hash[key];
}
this.count = function(){
var i=0;
for(var k in this._hash)
i++;
return i;
}
this.items = function(key){
return this._hash[key];
}
this.contains = function(key){
return typeof(this._hash[key])!="undefined";
}
this.clear = function(){
for(var k in this._hash){
delete this._hash[k];
}
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2021-08-31
  • 2021-11-05
  • 2021-05-29
猜你喜欢
  • 2021-05-24
  • 2021-10-31
  • 2021-07-24
  • 2022-12-23
  • 2021-06-21
相关资源
相似解决方案