Function to be used as
var hasmp1=Collection.HashMap();
var hasmp2=Collection.HashMap();
hasmp1.set('1','AAAAA1');
hasmp2.set('2','BBBBB2');
alert("MAP1 :"+hasmp1.get('1')+" MAP2:"+hasmp2.get('1'));
=========================================================================
Only a few Method is implemented as of Now.
- boolean isEmpty() Returns true if this map contains no key-value mappings.
- Set keySet() Returns a set view of the keys contained in this map.
- Object put(Object key, Object value) Associates the specified value with the specified key in this map.
- void putAll(Map m) Copies all of the mappings from the specified map to this map These mappings will replace any mappings that this map had for any of the keys currently in the specified map.
- Object remove(Object key) Removes the mapping for this key from this map if present.
- int size() Returns the number of key-value mappings in this map.
- Collection values() Returns a collection view of the values contained in this map.
*/
var Collection={
HashMap:function(){
var hashMap = {
put : function(key,val) {this[key] = val;},
get : function(key) {return this[key];}
}
return hashMap;
}
}