// (c)2011 MrOrange

﻿
mrO.orderedDictionary=function(id,className,args){mrO.object.call(this,id,className,args);var defaultSettings={keyPropertyName:"Key",items:[]};this.applyDefaultSettings(defaultSettings);this.dictionary={};this.items=this.settings.items;var keyPropertyName=this.settings.keyPropertyName;for(var i=0;i<this.items.length;i++){this.dictionary[this.items[i][keyPropertyName]]=i;}};mrO.orderedDictionary.prototype=new mrO.object;mrO.orderedDictionary.prototype.initObject=mrO.orderedDictionary.prototype.init;mrO.orderedDictionary.prototype.init=function(args){this.initObject(args);};mrO.orderedDictionary.prototype.getItemByKey=function(key){return this.items[this.dictionary[key]];};mrO.orderedDictionary.prototype.getItemByIndex=function(index){return this.items[index];};
