1RS.declare("RS.util.Collection",{allowMove:!1,constructor:function(t){this.callParent([$.extend(t,{items:{},keyToStack:{},sortStack:[]})])},add:function(t,e){return this.hasKey(e)&&$.error("Key already exists: "+JSON.stringify(e)),this.insertAt(t,this.sortStack.length,e)},insertAt:function(t,e,i){void 0===i&&"function"!==$.type(t.getId)&&$.error("Element must be object implementing getId if no explicit key is specified"),i=i||t.getId(),!this.allowMove&&this.hasKey(i)&&$.error('Duplicate key "'+i+'" found');var n=this.hasKey(i);if(!1===this.onBeforeInsert(t,e,i,n)||!this.fireEvent("beforeinsert",t,e,i,n))return!1;n&&(this.suspendEvents(),this.removeByKey(i),this.resumeEvents()),this.items[i]=t,this.keyToStack[i]=e,this.sortStack.splice(e,0,i);for(var r=this.sortStack.length-1;e<=r;r--)this.keyToStack[this.sortStack[r]]=r;return this.onInsert(t,e,i,n),this.fireEvent("insert",t,e,i,n),e},onBeforeInsert:RS.emptyFn,onInsert:RS.emptyFn,hasKey:function(t){return this.items.hasOwnProperty(t)},indexOfKey:function(t){return!t in this.keyToStack?-1:this.keyToStack[t]},removeAt:function(t){return this.removeByKey(this.sortStack[t])},removeByKey:function(t){if(this.hasKey(t)&&!1!==this.onBeforeRemove(t)&&!1!==this.fireEvent("beforeremove",t)){var e=this.items[t],i=this.keyToStack[t];this.sortStack.splice(this.keyToStack[t],1),delete this.keyToStack[t],delete this.items[t];for(var n=i;n<this.sortStack.length;n++)this.keyToStack[this.sortStack[n]]=n;return this.onRemove(e,i,t),this.fireEvent("remove",e,i,t),i}return!1},onBeforeRemove:RS.emptyFn,onRemove:RS.emptyFn,getByKey:function(t){return this.items[t]},getAt:function(t){return this.items[this.getKeyAt(t)]},getKeyAt:function(t){return this.sortStack[t]},clear:function(){var t=this.items;this.items={},this.sortStack.length=0,this.keyToStack={},this.fireEvent("clear",t)},each:function(t,e){var i,n,r=this,s=r.sortStack.length;if("function"!==$.type(t)&&$.error("Callback must be function"),s)if(!0===e)for(i=s-1;0<=i&&(n=r.sortStack[i],!1!==t.call(r,r.getByKey(n),n));i--);else for(i=0;i<s&&(n=r.sortStack[i],!1!==t.call(r,r.getByKey(n),n));i++);},contains:function(e){var i=!1;return this.each(function(t){if(t===e)return!(i=!0)}),i},getKeys:function(){return Object.keys(this.items)},getSize:function(){return this.sortStack.length},sortBy:function(i){var n=this;n.fireEvent("beforesort"),n.sortStack.sort(function(t,e){return i(n.getByKey(t),n.getByKey(e))}),n.keyToStack={},$.each(n.sortStack,function(t,e){n.keyToStack[e]=t}),n.fireEvent("sort")},first:function(){return this.getAt(0)},findBy:function(i){var n=null;return this.each(function(t,e){if(i(t))return n=e,!1}),n},findItemBy:function(t){var e=this.findBy(t);return!1!==e&&this.getByKey(e)},toArray:function(){var e=[];return this.each(function(t){e.push(t)}),e}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.