/**
* javascript map
*/
Ext.namespace("Ext.Map");
function struct(key, value) {
this.key = key;
this.value = value;
}
function put(key, value) {
for (var i = 0; i < this.arr.length; i++) {
if (this.arr[i].key === key) {
this.arr[i].value = value;
return;
}
}
this.arr[this.arr.length] = new struct(key, value);
}
function get(key) {
for (var i = 0; i < this.arr.length; i++) {
if (this.arr[i].key === key) {
return this.arr[i].value;
}
}
return null;
}
function getValue(index) {
return this.arr[index].value;
}
function getKey(index) {
return this.arr[index].key;
}
function remove(key) {
var v;
for (var i = 0; i < this.arr.length; i++) {
v = this.arr.pop();
if (v.key === key){
continue;
}
this.arr.unshift(v);
}
}
function size() {
return this.arr.length;
}
function isEmpty() {
return this.arr.length <= 0;
}
function Map() {
this.arr = new Array();
this.get = get;
this.getKey = getKey;
this.getValue = getValue;
this.put = put;
this.remove = remove;
this.size = size;
this.isEmpty = isEmpty;
this.sort = sort;
}
function sort() {
}