~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to lib/yuilib/3.13.0/recordset-base/recordset-base-coverage.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.13.0 (build 508226d)
 
3
Copyright 2013 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
 
 
8
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
 
9
if (!__coverage__['build/recordset-base/recordset-base.js']) {
 
10
   __coverage__['build/recordset-base/recordset-base.js'] = {"path":"build/recordset-base/recordset-base.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}},"2":{"name":"(anonymous_2)","line":9,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":23}}},"3":{"name":"(anonymous_3)","line":13,"loc":{"start":{"line":13,"column":17},"end":{"line":13,"column":28}}},"4":{"name":"(anonymous_4)","line":16,"loc":{"start":{"line":16,"column":16},"end":{"line":16,"column":27}}},"5":{"name":"(anonymous_5)","line":26,"loc":{"start":{"line":26,"column":14},"end":{"line":26,"column":30}}},"6":{"name":"(anonymous_6)","line":94,"loc":{"start":{"line":94,"column":17},"end":{"line":94,"column":28}}},"7":{"name":"(anonymous_7)","line":191,"loc":{"start":{"line":191,"column":15},"end":{"line":191,"column":27}}},"8":{"name":"(anonymous_8)","line":210,"loc":{"start":{"line":210,"column":22},"end":{"line":210,"column":34}}},"9":{"name":"(anonymous_9)","line":222,"loc":{"start":{"line":222,"column":23},"end":{"line":222,"column":46}}},"10":{"name":"(anonymous_10)","line":240,"loc":{"start":{"line":240,"column":15},"end":{"line":240,"column":26}}},"11":{"name":"(anonymous_11)","line":254,"loc":{"start":{"line":254,"column":20},"end":{"line":254,"column":34}}},"12":{"name":"(anonymous_12)","line":273,"loc":{"start":{"line":273,"column":9},"end":{"line":273,"column":32}}},"13":{"name":"(anonymous_13)","line":307,"loc":{"start":{"line":307,"column":12},"end":{"line":307,"column":35}}},"14":{"name":"(anonymous_14)","line":331,"loc":{"start":{"line":331,"column":11},"end":{"line":331,"column":22}}},"15":{"name":"(anonymous_15)","line":346,"loc":{"start":{"line":346,"column":12},"end":{"line":346,"column":34}}},"16":{"name":"(anonymous_16)","line":377,"loc":{"start":{"line":377,"column":15},"end":{"line":377,"column":27}}},"17":{"name":"(anonymous_17)","line":390,"loc":{"start":{"line":390,"column":18},"end":{"line":390,"column":30}}},"18":{"name":"(anonymous_18)","line":402,"loc":{"start":{"line":402,"column":18},"end":{"line":402,"column":30}}},"19":{"name":"(anonymous_19)","line":416,"loc":{"start":{"line":416,"column":17},"end":{"line":416,"column":29}}},"20":{"name":"(anonymous_20)","line":427,"loc":{"start":{"line":427,"column":17},"end":{"line":427,"column":30}}},"21":{"name":"(anonymous_21)","line":456,"loc":{"start":{"line":456,"column":24},"end":{"line":456,"column":48}}},"22":{"name":"(anonymous_22)","line":468,"loc":{"start":{"line":468,"column":21},"end":{"line":468,"column":36}}},"23":{"name":"(anonymous_23)","line":485,"loc":{"start":{"line":485,"column":14},"end":{"line":485,"column":37}}},"24":{"name":"(anonymous_24)","line":508,"loc":{"start":{"line":508,"column":17},"end":{"line":508,"column":40}}},"25":{"name":"(anonymous_25)","line":530,"loc":{"start":{"line":530,"column":17},"end":{"line":530,"column":41}}},"26":{"name":"(anonymous_26)","line":550,"loc":{"start":{"line":550,"column":16},"end":{"line":550,"column":27}}},"27":{"name":"(anonymous_27)","line":560,"loc":{"start":{"line":560,"column":20},"end":{"line":560,"column":31}}},"28":{"name":"(anonymous_28)","line":572,"loc":{"start":{"line":572,"column":21},"end":{"line":572,"column":35}}},"29":{"name":"(anonymous_29)","line":585,"loc":{"start":{"line":585,"column":17},"end":{"line":585,"column":34}}},"30":{"name":"(anonymous_30)","line":614,"loc":{"start":{"line":614,"column":20},"end":{"line":614,"column":31}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":650,"column":50}},"2":{"start":{"line":8,"column":0},"end":{"line":57,"column":3}},"3":{"start":{"line":10,"column":8},"end":{"line":10,"column":24}},"4":{"start":{"line":27,"column":8},"end":{"line":32,"column":9}},"5":{"start":{"line":28,"column":12},"end":{"line":28,"column":36}},"6":{"start":{"line":31,"column":12},"end":{"line":31,"column":43}},"7":{"start":{"line":33,"column":8},"end":{"line":33,"column":20}},"8":{"start":{"line":59,"column":0},"end":{"line":59,"column":18}},"9":{"start":{"line":69,"column":0},"end":{"line":644,"column":3}},"10":{"start":{"line":98,"column":8},"end":{"line":100,"column":9}},"11":{"start":{"line":99,"column":12},"end":{"line":99,"column":29}},"12":{"start":{"line":103,"column":8},"end":{"line":172,"column":11}},"13":{"start":{"line":174,"column":8},"end":{"line":174,"column":46}},"14":{"start":{"line":176,"column":8},"end":{"line":181,"column":40}},"15":{"start":{"line":193,"column":8},"end":{"line":198,"column":9}},"16":{"start":{"line":194,"column":12},"end":{"line":194,"column":40}},"17":{"start":{"line":196,"column":13},"end":{"line":198,"column":9}},"18":{"start":{"line":197,"column":12},"end":{"line":197,"column":34}},"19":{"start":{"line":199,"column":8},"end":{"line":199,"column":20}},"20":{"start":{"line":211,"column":8},"end":{"line":211,"column":30}},"21":{"start":{"line":223,"column":8},"end":{"line":224,"column":29}},"22":{"start":{"line":226,"column":8},"end":{"line":226,"column":65}},"23":{"start":{"line":228,"column":8},"end":{"line":230,"column":9}},"24":{"start":{"line":229,"column":12},"end":{"line":229,"column":57}},"25":{"start":{"line":231,"column":8},"end":{"line":231,"column":31}},"26":{"start":{"line":241,"column":8},"end":{"line":241,"column":27}},"27":{"start":{"line":255,"column":8},"end":{"line":257,"column":21}},"28":{"start":{"line":258,"column":8},"end":{"line":260,"column":9}},"29":{"start":{"line":259,"column":12},"end":{"line":259,"column":55}},"30":{"start":{"line":261,"column":8},"end":{"line":261,"column":23}},"31":{"start":{"line":275,"column":8},"end":{"line":277,"column":14}},"32":{"start":{"line":279,"column":8},"end":{"line":279,"column":81}},"33":{"start":{"line":282,"column":8},"end":{"line":288,"column":9}},"34":{"start":{"line":283,"column":12},"end":{"line":285,"column":13}},"35":{"start":{"line":284,"column":16},"end":{"line":284,"column":63}},"36":{"start":{"line":286,"column":15},"end":{"line":288,"column":9}},"37":{"start":{"line":287,"column":12},"end":{"line":287,"column":56}},"38":{"start":{"line":290,"column":8},"end":{"line":293,"column":11}},"39":{"start":{"line":294,"column":8},"end":{"line":294,"column":20}},"40":{"start":{"line":308,"column":8},"end":{"line":308,"column":28}},"41":{"start":{"line":311,"column":8},"end":{"line":311,"column":63}},"42":{"start":{"line":312,"column":8},"end":{"line":312,"column":39}},"43":{"start":{"line":314,"column":8},"end":{"line":314,"column":63}},"44":{"start":{"line":315,"column":8},"end":{"line":319,"column":11}},"45":{"start":{"line":322,"column":8},"end":{"line":322,"column":20}},"46":{"start":{"line":332,"column":8},"end":{"line":332,"column":31}},"47":{"start":{"line":333,"column":8},"end":{"line":333,"column":20}},"48":{"start":{"line":347,"column":8},"end":{"line":349,"column":18}},"49":{"start":{"line":353,"column":8},"end":{"line":353,"column":54}},"50":{"start":{"line":354,"column":8},"end":{"line":354,"column":59}},"51":{"start":{"line":356,"column":8},"end":{"line":358,"column":9}},"52":{"start":{"line":357,"column":12},"end":{"line":357,"column":50}},"53":{"start":{"line":360,"column":8},"end":{"line":364,"column":11}},"54":{"start":{"line":366,"column":8},"end":{"line":366,"column":20}},"55":{"start":{"line":378,"column":8},"end":{"line":378,"column":76}},"56":{"start":{"line":391,"column":8},"end":{"line":391,"column":50}},"57":{"start":{"line":403,"column":8},"end":{"line":405,"column":9}},"58":{"start":{"line":404,"column":12},"end":{"line":404,"column":74}},"59":{"start":{"line":417,"column":8},"end":{"line":417,"column":25}},"60":{"start":{"line":428,"column":8},"end":{"line":430,"column":20}},"61":{"start":{"line":434,"column":8},"end":{"line":434,"column":64}},"62":{"start":{"line":436,"column":8},"end":{"line":437,"column":73}},"63":{"start":{"line":439,"column":8},"end":{"line":441,"column":9}},"64":{"start":{"line":440,"column":12},"end":{"line":440,"column":39}},"65":{"start":{"line":457,"column":8},"end":{"line":457,"column":41}},"66":{"start":{"line":469,"column":8},"end":{"line":469,"column":62}},"67":{"start":{"line":486,"column":8},"end":{"line":487,"column":19}},"68":{"start":{"line":489,"column":8},"end":{"line":491,"column":9}},"69":{"start":{"line":490,"column":12},"end":{"line":490,"column":47}},"70":{"start":{"line":493,"column":8},"end":{"line":493,"column":20}},"71":{"start":{"line":509,"column":8},"end":{"line":511,"column":9}},"72":{"start":{"line":510,"column":12},"end":{"line":510,"column":47}},"73":{"start":{"line":513,"column":8},"end":{"line":513,"column":20}},"74":{"start":{"line":531,"column":8},"end":{"line":533,"column":9}},"75":{"start":{"line":532,"column":12},"end":{"line":532,"column":75}},"76":{"start":{"line":535,"column":8},"end":{"line":535,"column":62}},"77":{"start":{"line":551,"column":8},"end":{"line":551,"column":18}},"78":{"start":{"line":561,"column":8},"end":{"line":561,"column":80}},"79":{"start":{"line":573,"column":8},"end":{"line":573,"column":77}},"80":{"start":{"line":586,"column":8},"end":{"line":588,"column":9}},"81":{"start":{"line":587,"column":12},"end":{"line":587,"column":45}},"82":{"start":{"line":590,"column":8},"end":{"line":591,"column":19}},"83":{"start":{"line":594,"column":8},"end":{"line":596,"column":9}},"84":{"start":{"line":595,"column":12},"end":{"line":595,"column":56}},"85":{"start":{"line":598,"column":8},"end":{"line":598,"column":39}},"86":{"start":{"line":616,"column":16},"end":{"line":616,"column":44}},"87":{"start":{"line":645,"column":0},"end":{"line":645,"column":32}},"88":{"start":{"line":646,"column":0},"end":{"line":646,"column":24}}},"branchMap":{"1":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":8},"end":{"line":27,"column":8}},{"start":{"line":27,"column":8},"end":{"line":27,"column":8}}]},"2":{"line":98,"type":"if","locations":[{"start":{"line":98,"column":8},"end":{"line":98,"column":8}},{"start":{"line":98,"column":8},"end":{"line":98,"column":8}}]},"3":{"line":193,"type":"if","locations":[{"start":{"line":193,"column":8},"end":{"line":193,"column":8}},{"start":{"line":193,"column":8},"end":{"line":193,"column":8}}]},"4":{"line":196,"type":"if","locations":[{"start":{"line":196,"column":13},"end":{"line":196,"column":13}},{"start":{"line":196,"column":13},"end":{"line":196,"column":13}}]},"5":{"line":226,"type":"cond-expr","locations":[{"start":{"line":226,"column":56},"end":{"line":226,"column":61}},{"start":{"line":226,"column":63},"end":{"line":226,"column":64}}]},"6":{"line":226,"type":"binary-expr","locations":[{"start":{"line":226,"column":17},"end":{"line":226,"column":37}},{"start":{"line":226,"column":42},"end":{"line":226,"column":51}}]},"7":{"line":279,"type":"cond-expr","locations":[{"start":{"line":279,"column":55},"end":{"line":279,"column":60}},{"start":{"line":279,"column":62},"end":{"line":279,"column":80}}]},"8":{"line":279,"type":"binary-expr","locations":[{"start":{"line":279,"column":15},"end":{"line":279,"column":35}},{"start":{"line":279,"column":40},"end":{"line":279,"column":50}}]},"9":{"line":282,"type":"if","locations":[{"start":{"line":282,"column":8},"end":{"line":282,"column":8}},{"start":{"line":282,"column":8},"end":{"line":282,"column":8}}]},"10":{"line":286,"type":"if","locations":[{"start":{"line":286,"column":15},"end":{"line":286,"column":15}},{"start":{"line":286,"column":15},"end":{"line":286,"column":15}}]},"11":{"line":311,"type":"cond-expr","locations":[{"start":{"line":311,"column":31},"end":{"line":311,"column":36}},{"start":{"line":311,"column":39},"end":{"line":311,"column":61}}]},"12":{"line":312,"type":"cond-expr","locations":[{"start":{"line":312,"column":30},"end":{"line":312,"column":35}},{"start":{"line":312,"column":37},"end":{"line":312,"column":38}}]},"13":{"line":353,"type":"cond-expr","locations":[{"start":{"line":353,"column":40},"end":{"line":353,"column":46}},{"start":{"line":353,"column":49},"end":{"line":353,"column":53}}]},"14":{"line":391,"type":"binary-expr","locations":[{"start":{"line":391,"column":36},"end":{"line":391,"column":43}},{"start":{"line":391,"column":47},"end":{"line":391,"column":48}}]},"15":{"line":436,"type":"binary-expr","locations":[{"start":{"line":436,"column":18},"end":{"line":436,"column":31}},{"start":{"line":437,"column":20},"end":{"line":437,"column":72}}]},"16":{"line":439,"type":"if","locations":[{"start":{"line":439,"column":8},"end":{"line":439,"column":8}},{"start":{"line":439,"column":8},"end":{"line":439,"column":8}}]},"17":{"line":531,"type":"if","locations":[{"start":{"line":531,"column":8},"end":{"line":531,"column":8}},{"start":{"line":531,"column":8},"end":{"line":531,"column":8}}]},"18":{"line":531,"type":"binary-expr","locations":[{"start":{"line":531,"column":12},"end":{"line":531,"column":25}},{"start":{"line":531,"column":29},"end":{"line":531,"column":49}}]},"19":{"line":561,"type":"binary-expr","locations":[{"start":{"line":561,"column":59},"end":{"line":561,"column":70}},{"start":{"line":561,"column":74},"end":{"line":561,"column":76}}]},"20":{"line":573,"type":"cond-expr","locations":[{"start":{"line":573,"column":43},"end":{"line":573,"column":46}},{"start":{"line":573,"column":49},"end":{"line":573,"column":76}}]},"21":{"line":586,"type":"if","locations":[{"start":{"line":586,"column":8},"end":{"line":586,"column":8}},{"start":{"line":586,"column":8},"end":{"line":586,"column":8}}]}},"code":["(function () { YUI.add('recordset-base', function (Y, NAME) {","","/**"," * Provides a wrapper around a standard javascript object. Can be inserted into a Recordset instance."," *"," * @class Record"," */","var Record = Y.Base.create('record', Y.Base, [], {","    _setId: function() {","        return Y.guid();","    },","","    initializer: function() {","    },","","    destructor: function() {","    },","","    /**","     * Retrieve a particular (or all) values from the object","     *","     * @param field {string} (optional) The key to retrieve the value from. If not supplied, the entire object is returned.","     * @method getValue","     * @public","     */","    getValue: function(field) {","        if (field === undefined) {","            return this.get(\"data\");","        }","        else {","            return this.get(\"data\")[field];","        }","        return null;","    }","},","{","    ATTRS: {","","        /**","        * @description Unique ID of the record instance","        * @attribute id","        * @type string","        */","        id: {","            valueFn: \"_setId\"","        },","","        /**","        * @description The object stored within the record instance","        * @attribute data","        * @type object","        */","        data: {","            value: null","        }","    }","});","","Y.Record = Record;","/**","The Recordset utility provides a standard way for dealing with","a collection of similar objects.","@module recordset","@main recordset","@submodule recordset-base","**/","","","var ArrayList = Y.ArrayList,","Lang = Y.Lang,","","/**","The Recordset utility provides a standard way for dealing with","a collection of similar objects.","","Provides the base Recordset implementation, which can be extended to add","additional functionality, such as custom indexing. sorting, and filtering.","","@class Recordset","@extends Base","@uses ArrayList","@param config {Object} Configuration object with initial attribute values","@constructor","**/","Recordset = Y.Base.create('recordset', Y.Base, [], {","","","    /**","     * Publish default functions for events. Create the initial hash table.","     *","     * @method initializer","     * @protected","     */","    initializer: function() {","        // The reason the conditional is needed is because of two scenarios:","        // 1. Instantiating new Y.Recordset() will not go into the setter of \"records\", and so it is necessary to create this._items in the initializer.","        // 2. Instantiating new Y.Recordset({records: [{...}]}) will call the setter of \"records\" and create this._items. In this case, we don't want that to be overwritten by [].","        if (!this._items) {","            this._items = [];","        }","","        //set up event listener to fire events when recordset is modified in anyway","        this.publish({","            /**","             * <p>At least one record is being added. Additional properties of","             * the event are:</p>","             * <dl>","             *     <dt>added</dt>","             *         <dd>Array of new records to be added</dd>","             *     <dt>index</dt>","             *         <dd>The insertion index in the Recordset's internal","             *         array</dd>","             * </dl>","             *","             * <p>Preventing this event will cause the new records NOT to be","             * added to the Recordset's internal collection.</p>","             *","             * @event add","             * @preventable _defAddFn","             */","            add: { defaultFn: this._defAddFn },","","            /**","             * <p>At least one record is being removed. Additional properties of","             * the event are:</p>","             * <dl>","             *     <dt>removed</dt>","             *         <dd>Array of records to be removed</dd>","             *     <dt>range</dt>","             *         <dd>Number of records to be removed</dd>","             *     <dt>index</dt>","             *         <dd>The starting index in the Recordset's internal","             *         array from which to remove records</dd>","             * </dl>","             *","             * <p>Preventing this event will cause the records NOT to be","             * removed from the Recordset's internal collection.</p>","             *","             * @event remove","             * @preventable _defRemoveFn","             */","            remove: { defaultFn: this._defRemoveFn },","","            /**","             * The Recordset is being flushed of all records.","             *","             * @event empty","             * @preventable _defEmptyFn","             */","            empty: { defaultFn: this._defEmptyFn },","","            /**","             * <p>At least one record is being updated. Additional properties of","             * the event are:</p>","             * <dl>","             *     <dt>updated</dt>","             *         <dd>Array of records with updated values</dd>","             *     <dt>overwritten</dt>","             *         <dd>Array of current records that will be replaced</dd>","             *     <dt>index</dt>","             *         <dd>The starting index in the Recordset's internal","             *         array from which to update will apply</dd>","             * </dl>","             *","             * <p>Preventing this event will cause the records NOT to be","             * updated in the Recordset's internal collection.</p>","             *","             * @event update","             * @preventable _defUpdateFn","             */","            update: { defaultFn: this._defUpdateFn }","        });","","        this._buildHashTable(this.get('key'));","","        this.after([","            'recordsChange',","            'add',","            'remove',","            'update',","            'empty'], this._updateHash);","    },","","    /**","     * Returns the record with particular ID or index","     *","     * @method getRecord","     * @param i {String, Number} The ID of the record if a string, or the index if a number.","     * @return {Record} A Y.Record instance","     */","    getRecord: function(i) {","","        if (Lang.isString(i)) {","            return this.get('table')[i];","        }","        else if (Lang.isNumber(i)) {","            return this._items[i];","        }","        return null;","    },","","","    /**","     * Returns the record at a particular index","     *","     * @method getRecordByIndex","     * @param i {Number} Index at which the required record resides","     * @return {Record} A Y.Record instance","     */","    getRecordByIndex: function(i) {","        return this._items[i];","    },","","    /**","     * Returns a range of records beginning at particular index","     *","     * @method getRecordsByIndex","     * @param index {Number} Index at which the required record resides","     * @param range {Number} (Optional) Number of records to retrieve. The default is 1","     * @return {Array} An array of Y.Record instances","     */","    getRecordsByIndex: function(index, range) {","        var i = 0,","        returnedRecords = [];","        //Range cannot take on negative values","        range = (Lang.isNumber(range) && (range > 0)) ? range: 1;","","        for (; i < range; i++) {","            returnedRecords.push(this._items[index + i]);","        }","        return returnedRecords;","    },","","    /**","     * Returns the length of the recordset","     *","     * @method getLength","     * @return {Number} Number of records in the recordset","     */","    getLength: function() {","        return this.size();","    },","","    /**","    Gets an array of values for a data _key_ in the set's records.  If no _key_","    is supplied, the returned array will contain the full data object for each","    record.","","    @method getValuesByKey","    @param {String} [key] Data property to get from all records","    @return {Array} An array of values for the given _key_ if supplied.","        Otherwise, an array of each record's data hash.","    **/","    getValuesByKey: function(key) {","        var i = 0,","        len = this._items.length,","        retVals = [];","        for (; i < len; i++) {","            retVals.push(this._items[i].getValue(key));","        }","        return retVals;","    },","","","    /**","     * Adds one or more Records to the RecordSet at the given index. If index is null, then adds the Records to the end of the RecordSet.","     *","     * @method add","     * @param {Record|Object|Array} oData A Y.Record instance, An object literal of data or an array of object literals","     * @param [index] {Number} [index] Index at which to add the record(s)","     * @return {Recordset} The updated recordset instance","     */","    add: function(oData, index) {","","        var newRecords = [],","        idx,","        i = 0;","","        idx = (Lang.isNumber(index) && (index > -1)) ? index: this._items.length;","","        //Passing in array of object literals for oData","        if (Lang.isArray(oData)) {","            for (; i < oData.length; i++) {","                newRecords[i] = this._changeToRecord(oData[i]);","            }","        } else if (Lang.isObject(oData)) {","            newRecords[0] = this._changeToRecord(oData);","        }","","        this.fire('add', {","            added: newRecords,","            index: idx","        });","        return this;","    },","","    /**","    Removes one or more Records to the RecordSet at the given index. If index","    is null, then removes a single Record from the end of the RecordSet.","","    @method remove","    @param {Number} [index] Index at which to remove the record(s) from","    @param {Number} [range] Number of records to remove (including the one","        at the index)","    @return {Recordset} The updated recordset instance","    **/","    remove: function(index, range) {","        var remRecords = [];","","        //Default is to only remove the last record - the length is always 1 greater than the last index","        index = (index > -1) ? index: (this._items.length - 1);","        range = (range > 0) ? range: 1;","","        remRecords = this._items.slice(index, (index + range));","        this.fire('remove', {","            removed: remRecords,","            range: range,","            index: index","        });","        //this._recordRemoved(remRecords, index);","        //return ({data: remRecords, index:index});","        return this;","    },","","    /**","     * Empties the recordset","     *","     * @method empty","     * @return {Recordset} The updated recordset instance","     */","    empty: function() {","        this.fire('empty', {});","        return this;","    },","","    /**","    Updates the recordset with the new records passed in. Overwrites existing","    records when updating the index with the new records.","","    @method update","    @param {Record|Object|Array} data A Y.Record instance, An object literal of","        data or an array of object literals","    @param {Number} [index] The index to start updating from.","    @return {Recordset} The updated recordset instance","    **/","    update: function(data, index) {","        var rec,","            arr,","            i = 0;","","        // Whatever is passed in, we are changing it to an array so that it can","        // be easily iterated in the _defUpdateFn method","        arr = (!(Lang.isArray(data))) ? [data] : data;","        rec = this._items.slice(index, index + arr.length);","","        for (; i < arr.length; i++) {","            arr[i] = this._changeToRecord(arr[i]);","        }","","        this.fire('update', {","            updated: arr,","            overwritten: rec,","            index: index","        });","","        return this;","    },","","    /**","     * Default behavior for the \"add\" event. Adds Record instances starting from","     * the index specified in `e.index`.","     *","     * @method _defAddFn","     * @param {EventFacade} e The add event","     * @private","     */","    _defAddFn: function(e) {","        this._items.splice.apply(this._items, [e.index, 0].concat(e.added));","    },","","    /**","     * Default behavior for the \"remove\" event. Removes Records from the","     * internal array starting from `e.index`.  By default, it will remove one","     * Record. But if `e.range` is set, it will remove that many Records.","     *","     * @method _defRemoveFn","     * @param {EventFacade} e The remove event","     * @private","     */","    _defRemoveFn: function(e) {","        this._items.splice(e.index, e.range || 1);","    },","","    /**","     * Default behavior for the \"update\" event. Sets Record instances for each","     * item in `e.updated` at indexes starting from `e.index`.","     *","     * @method _defUpdateFn","     * @param {EventFacade} e The update event","     * @private","     */","    _defUpdateFn: function(e) {","        for (var i = 0; i < e.updated.length; i++) {","            this._items[e.index + i] = this._changeToRecord(e.updated[i]);","        }","    },","","    /**","     * Default behavior for the \"empty\" event. Clears the internal array of","     * Records.","     *","     * @method _defEmptyFn","     * @param {EventFacade} e The empty event","     * @private","     */","    _defEmptyFn: function(e) {","        this._items = [];","    },","","    /**","    Updates the internal hash table.","","    @method _defUpdateHash","    @param {EventFacade} e Event triggering the hash table update","    @private","    **/","    _updateHash: function (e) {","        var handler = \"_hash\",","            type = e.type.replace(/.*:/,''),","            newHash;","","        // _hashAdd, _hashRemove, _hashEmpty, etc","        // Not a switch or else if setup to allow for external expansion.","        handler += type.charAt(0).toUpperCase() + type.slice(1);","","        newHash = this[handler] &&","                    this[handler](this.get('table'), this.get('key'), e);","","        if (newHash) {","            this.set('table', newHash);","        }","    },","","    /**","    Regenerates the hash table from the current internal array of Records.","","    @method _hashRecordsChange","    @param {Object} hash The hash map before replacement","    @param {String} key The key by which to add items to the hash","    @param {Object} e The event or object containing the items to be added.","                      Items are expected to be stored in an array assigned to","                      the `added` property.","    @return {Object} The updated hash map","    @private","    **/","    _hashRecordsChange: function (hash, key, e) {","        return this._buildHashTable(key);","    },","","    /**","    Builds a hash table from the current internal array of Records.","","    @method _buildHashTable","    @param {String} key The Record key to hash the items by","    @return {Object} A new hash map of Records keyed by each Records' key","    @private","    **/","    _buildHashTable: function (key) {","        return this._hashAdd({}, key, { added: this._items });","    },","","    /**","    Adds items to the hash table.  Items are the values, and the keys are the","    values of the item's attribute named in the `key` parameter.","","    @method _hashAdd","    @param {Object} hash The hash map before adding items","    @param {String} key The key by which to add the items to the hash","    @param {Object} e The event or object containing the items to be added.","                      Items are expected to be stored in an array assigned to","                      the `added` property.","    @return {Object} The updated hash map","    @private","    **/","    _hashAdd: function(hash, key, e) {","        var items = e.added,","            i, len;","","        for (i = 0, len = e.added.length; i < len; ++i) {","            hash[items[i].get(key)] = items[i];","        }","","        return hash;","    },","","    /**","    Removes items from the hash table.","","    @method _hashRemove","    @param {Object} hash The hash map before removing items","    @param {String} key The key by which to remove the items from the hash","    @param {Object} e The event or object containing the items to be removed.","                      Items are expected to be stored in an array assigned to","                      the `removed` property.","    @return {Object} The updated hash map","    @private","    **/","    _hashRemove: function(hash, key, e) {","        for (var i = e.removed.length - 1; i >= 0; --i) {","            delete hash[e.removed[i].get(key)];","        }","","        return hash;","    },","","    /**","    Updates items in the hash table.","","    @method _hashUpdate","    @param {Object} hash The hash map before updating items","    @param {String} key The key by which to update the items to the hash","    @param {Object} e The event or object containing the items to be updated.","                      Items are expected to be stored in an array assigned to","                      the `updated` property. Optionally, items can be","                      identified for being overwritten by including them in an","                      array assigned to the `overwritten` property.","    @return {Object} The updated hash map","    @private","    **/","    _hashUpdate: function (hash, key, e) {","        if (e.overwritten && e.overwritten.length) {","            hash = this._hashRemove(hash, key, { removed: e.overwritten });","        }","","        return this._hashAdd(hash, key, { added: e.updated });","    },","","    /**","    Clears the hash table.","","    @method _hashEmpty","    @param {Object} hash The hash map before adding items","    @param {String} key The key by which to remove the items from the hash","    @param {Object} e The event or object containing the items to be removed.","                      Items are expected to be stored in an array assigned to","                      the `removed` property.","    @return {Object} An empty hash","    @private","    **/","    _hashEmpty: function() {","        return {};","    },","","    /**","     * Sets up the hashtable with all the records currently in the recordset","     *","     * @method _initHashTable","     * @private","     */","    _initHashTable: function() {","        return this._hashAdd({}, this.get('key'), { added: this._items || [] });","    },","","    /**","     * Helper method - it takes an object bag and converts it to a Y.Record","     *","     * @method _changeToRecord","     * @param obj {Object|Record} Any objet literal or Y.Record instance","     * @return {Record} A Record instance.","     * @private","     */","    _changeToRecord: function(obj) {","        return (obj instanceof Y.Record) ? obj : new Y.Record({ data: obj });","    },","","    /**","    Ensures the value being set is an array of Record instances. If array items","    are raw object data, they are turned into Records.","","    @method _setRecords","    @param {Record[]|Object[]} items The Records or data Objects to store as","                                     Records.","    @return {Record[]}","    **/","    _setRecords: function (items) {","        if (!Y.Lang.isArray(items)) {","            return Y.Attribute.INVALID_VALUE;","        }","","        var records = [],","            i, len;","","        // FIXME: This should use the flyweight pattern if possible","        for (i = 0, len = items.length; i < len; ++i) {","            records[i] = this._changeToRecord(items[i]);","        }","","        return (this._items = records);","    }","}, {","    ATTRS: {","","        /**","        * An array of Records that the Recordset is storing.  Passing an array","        * of raw record data is also accepted.  The data for each item will be","        * wrapped in a Record instance.","        *","        * @attribute records","        * @type {Record[]}","        */","        records: {","            // TODO: necessary? valueFn?","            lazyAdd: false,","            getter: function() {","                // give them a copy, not the internal object","                return Y.Array(this._items);","            },","            setter: \"_setRecords\"","        },","","        /**","        A hash table where the ID of the record is the key, and the record","        instance is the value.","","        @attribute table","        @type object","        **/","        table: {","            valueFn: '_initHashTable'","        },","","        /**","        The ID to use as the key in the hash table.","","        @attribute key","        @type string","        **/","        key: {","            value: 'id',","            readOnly: true","        }","","    }","});","Y.augment(Recordset, ArrayList);","Y.Recordset = Recordset;","","","","}, '3.13.0', {\"requires\": [\"base\", \"arraylist\"]});","","}());"]};
 
11
}
 
12
var __cov_QYITB_80n6ZEw3MrTRovKA = __coverage__['build/recordset-base/recordset-base.js'];
 
13
__cov_QYITB_80n6ZEw3MrTRovKA.s['1']++;YUI.add('recordset-base',function(Y,NAME){__cov_QYITB_80n6ZEw3MrTRovKA.f['1']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['2']++;var Record=Y.Base.create('record',Y.Base,[],{_setId:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['2']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['3']++;return Y.guid();},initializer:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['3']++;},destructor:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['4']++;},getValue:function(field){__cov_QYITB_80n6ZEw3MrTRovKA.f['5']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['4']++;if(field===undefined){__cov_QYITB_80n6ZEw3MrTRovKA.b['1'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['5']++;return this.get('data');}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['1'][1]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['6']++;return this.get('data')[field];}__cov_QYITB_80n6ZEw3MrTRovKA.s['7']++;return null;}},{ATTRS:{id:{valueFn:'_setId'},data:{value:null}}});__cov_QYITB_80n6ZEw3MrTRovKA.s['8']++;Y.Record=Record;__cov_QYITB_80n6ZEw3MrTRovKA.s['9']++;var ArrayList=Y.ArrayList,Lang=Y.Lang,Recordset=Y.Base.create('recordset',Y.Base,[],{initializer:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['6']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['10']++;if(!this._items){__cov_QYITB_80n6ZEw3MrTRovKA.b['2'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['11']++;this._items=[];}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['2'][1]++;}__cov_QYITB_80n6ZEw3MrTRovKA.s['12']++;this.publish({add:{defaultFn:this._defAddFn},remove:{defaultFn:this._defRemoveFn},empty:{defaultFn:this._defEmptyFn},update:{defaultFn:this._defUpdateFn}});__cov_QYITB_80n6ZEw3MrTRovKA.s['13']++;this._buildHashTable(this.get('key'));__cov_QYITB_80n6ZEw3MrTRovKA.s['14']++;this.after(['recordsChange','add','remove','update','empty'],this._updateHash);},getRecord:function(i){__cov_QYITB_80n6ZEw3MrTRovKA.f['7']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['15']++;if(Lang.isString(i)){__cov_QYITB_80n6ZEw3MrTRovKA.b['3'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['16']++;return this.get('table')[i];}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['3'][1]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['17']++;if(Lang.isNumber(i)){__cov_QYITB_80n6ZEw3MrTRovKA.b['4'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['18']++;return this._items[i];}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['4'][1]++;}}__cov_QYITB_80n6ZEw3MrTRovKA.s['19']++;return null;},getRecordByIndex:function(i){__cov_QYITB_80n6ZEw3MrTRovKA.f['8']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['20']++;return this._items[i];},getRecordsByIndex:function(index,range){__cov_QYITB_80n6ZEw3MrTRovKA.f['9']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['21']++;var i=0,returnedRecords=[];__cov_QYITB_80n6ZEw3MrTRovKA.s['22']++;range=(__cov_QYITB_80n6ZEw3MrTRovKA.b['6'][0]++,Lang.isNumber(range))&&(__cov_QYITB_80n6ZEw3MrTRovKA.b['6'][1]++,range>0)?(__cov_QYITB_80n6ZEw3MrTRovKA.b['5'][0]++,range):(__cov_QYITB_80n6ZEw3MrTRovKA.b['5'][1]++,1);__cov_QYITB_80n6ZEw3MrTRovKA.s['23']++;for(;i<range;i++){__cov_QYITB_80n6ZEw3MrTRovKA.s['24']++;returnedRecords.push(this._items[index+i]);}__cov_QYITB_80n6ZEw3MrTRovKA.s['25']++;return returnedRecords;},getLength:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['10']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['26']++;return this.size();},getValuesByKey:function(key){__cov_QYITB_80n6ZEw3MrTRovKA.f['11']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['27']++;var i=0,len=this._items.length,retVals=[];__cov_QYITB_80n6ZEw3MrTRovKA.s['28']++;for(;i<len;i++){__cov_QYITB_80n6ZEw3MrTRovKA.s['29']++;retVals.push(this._items[i].getValue(key));}__cov_QYITB_80n6ZEw3MrTRovKA.s['30']++;return retVals;},add:function(oData,index){__cov_QYITB_80n6ZEw3MrTRovKA.f['12']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['31']++;var newRecords=[],idx,i=0;__cov_QYITB_80n6ZEw3MrTRovKA.s['32']++;idx=(__cov_QYITB_80n6ZEw3MrTRovKA.b['8'][0]++,Lang.isNumber(index))&&(__cov_QYITB_80n6ZEw3MrTRovKA.b['8'][1]++,index>-1)?(__cov_QYITB_80n6ZEw3MrTRovKA.b['7'][0]++,index):(__cov_QYITB_80n6ZEw3MrTRovKA.b['7'][1]++,this._items.length);__cov_QYITB_80n6ZEw3MrTRovKA.s['33']++;if(Lang.isArray(oData)){__cov_QYITB_80n6ZEw3MrTRovKA.b['9'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['34']++;for(;i<oData.length;i++){__cov_QYITB_80n6ZEw3MrTRovKA.s['35']++;newRecords[i]=this._changeToRecord(oData[i]);}}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['9'][1]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['36']++;if(Lang.isObject(oData)){__cov_QYITB_80n6ZEw3MrTRovKA.b['10'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['37']++;newRecords[0]=this._changeToRecord(oData);}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['10'][1]++;}}__cov_QYITB_80n6ZEw3MrTRovKA.s['38']++;this.fire('add',{added:newRecords,index:idx});__cov_QYITB_80n6ZEw3MrTRovKA.s['39']++;return this;},remove:function(index,range){__cov_QYITB_80n6ZEw3MrTRovKA.f['13']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['40']++;var remRecords=[];__cov_QYITB_80n6ZEw3MrTRovKA.s['41']++;index=index>-1?(__cov_QYITB_80n6ZEw3MrTRovKA.b['11'][0]++,index):(__cov_QYITB_80n6ZEw3MrTRovKA.b['11'][1]++,this._items.length-1);__cov_QYITB_80n6ZEw3MrTRovKA.s['42']++;range=range>0?(__cov_QYITB_80n6ZEw3MrTRovKA.b['12'][0]++,range):(__cov_QYITB_80n6ZEw3MrTRovKA.b['12'][1]++,1);__cov_QYITB_80n6ZEw3MrTRovKA.s['43']++;remRecords=this._items.slice(index,index+range);__cov_QYITB_80n6ZEw3MrTRovKA.s['44']++;this.fire('remove',{removed:remRecords,range:range,index:index});__cov_QYITB_80n6ZEw3MrTRovKA.s['45']++;return this;},empty:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['14']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['46']++;this.fire('empty',{});__cov_QYITB_80n6ZEw3MrTRovKA.s['47']++;return this;},update:function(data,index){__cov_QYITB_80n6ZEw3MrTRovKA.f['15']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['48']++;var rec,arr,i=0;__cov_QYITB_80n6ZEw3MrTRovKA.s['49']++;arr=!Lang.isArray(data)?(__cov_QYITB_80n6ZEw3MrTRovKA.b['13'][0]++,[data]):(__cov_QYITB_80n6ZEw3MrTRovKA.b['13'][1]++,data);__cov_QYITB_80n6ZEw3MrTRovKA.s['50']++;rec=this._items.slice(index,index+arr.length);__cov_QYITB_80n6ZEw3MrTRovKA.s['51']++;for(;i<arr.length;i++){__cov_QYITB_80n6ZEw3MrTRovKA.s['52']++;arr[i]=this._changeToRecord(arr[i]);}__cov_QYITB_80n6ZEw3MrTRovKA.s['53']++;this.fire('update',{updated:arr,overwritten:rec,index:index});__cov_QYITB_80n6ZEw3MrTRovKA.s['54']++;return this;},_defAddFn:function(e){__cov_QYITB_80n6ZEw3MrTRovKA.f['16']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['55']++;this._items.splice.apply(this._items,[e.index,0].concat(e.added));},_defRemoveFn:function(e){__cov_QYITB_80n6ZEw3MrTRovKA.f['17']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['56']++;this._items.splice(e.index,(__cov_QYITB_80n6ZEw3MrTRovKA.b['14'][0]++,e.range)||(__cov_QYITB_80n6ZEw3MrTRovKA.b['14'][1]++,1));},_defUpdateFn:function(e){__cov_QYITB_80n6ZEw3MrTRovKA.f['18']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['57']++;for(var i=0;i<e.updated.length;i++){__cov_QYITB_80n6ZEw3MrTRovKA.s['58']++;this._items[e.index+i]=this._changeToRecord(e.updated[i]);}},_defEmptyFn:function(e){__cov_QYITB_80n6ZEw3MrTRovKA.f['19']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['59']++;this._items=[];},_updateHash:function(e){__cov_QYITB_80n6ZEw3MrTRovKA.f['20']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['60']++;var handler='_hash',type=e.type.replace(/.*:/,''),newHash;__cov_QYITB_80n6ZEw3MrTRovKA.s['61']++;handler+=type.charAt(0).toUpperCase()+type.slice(1);__cov_QYITB_80n6ZEw3MrTRovKA.s['62']++;newHash=(__cov_QYITB_80n6ZEw3MrTRovKA.b['15'][0]++,this[handler])&&(__cov_QYITB_80n6ZEw3MrTRovKA.b['15'][1]++,this[handler](this.get('table'),this.get('key'),e));__cov_QYITB_80n6ZEw3MrTRovKA.s['63']++;if(newHash){__cov_QYITB_80n6ZEw3MrTRovKA.b['16'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['64']++;this.set('table',newHash);}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['16'][1]++;}},_hashRecordsChange:function(hash,key,e){__cov_QYITB_80n6ZEw3MrTRovKA.f['21']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['65']++;return this._buildHashTable(key);},_buildHashTable:function(key){__cov_QYITB_80n6ZEw3MrTRovKA.f['22']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['66']++;return this._hashAdd({},key,{added:this._items});},_hashAdd:function(hash,key,e){__cov_QYITB_80n6ZEw3MrTRovKA.f['23']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['67']++;var items=e.added,i,len;__cov_QYITB_80n6ZEw3MrTRovKA.s['68']++;for(i=0,len=e.added.length;i<len;++i){__cov_QYITB_80n6ZEw3MrTRovKA.s['69']++;hash[items[i].get(key)]=items[i];}__cov_QYITB_80n6ZEw3MrTRovKA.s['70']++;return hash;},_hashRemove:function(hash,key,e){__cov_QYITB_80n6ZEw3MrTRovKA.f['24']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['71']++;for(var i=e.removed.length-1;i>=0;--i){__cov_QYITB_80n6ZEw3MrTRovKA.s['72']++;delete hash[e.removed[i].get(key)];}__cov_QYITB_80n6ZEw3MrTRovKA.s['73']++;return hash;},_hashUpdate:function(hash,key,e){__cov_QYITB_80n6ZEw3MrTRovKA.f['25']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['74']++;if((__cov_QYITB_80n6ZEw3MrTRovKA.b['18'][0]++,e.overwritten)&&(__cov_QYITB_80n6ZEw3MrTRovKA.b['18'][1]++,e.overwritten.length)){__cov_QYITB_80n6ZEw3MrTRovKA.b['17'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['75']++;hash=this._hashRemove(hash,key,{removed:e.overwritten});}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['17'][1]++;}__cov_QYITB_80n6ZEw3MrTRovKA.s['76']++;return this._hashAdd(hash,key,{added:e.updated});},_hashEmpty:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['26']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['77']++;return{};},_initHashTable:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['27']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['78']++;return this._hashAdd({},this.get('key'),{added:(__cov_QYITB_80n6ZEw3MrTRovKA.b['19'][0]++,this._items)||(__cov_QYITB_80n6ZEw3MrTRovKA.b['19'][1]++,[])});},_changeToRecord:function(obj){__cov_QYITB_80n6ZEw3MrTRovKA.f['28']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['79']++;return obj instanceof Y.Record?(__cov_QYITB_80n6ZEw3MrTRovKA.b['20'][0]++,obj):(__cov_QYITB_80n6ZEw3MrTRovKA.b['20'][1]++,new Y.Record({data:obj}));},_setRecords:function(items){__cov_QYITB_80n6ZEw3MrTRovKA.f['29']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['80']++;if(!Y.Lang.isArray(items)){__cov_QYITB_80n6ZEw3MrTRovKA.b['21'][0]++;__cov_QYITB_80n6ZEw3MrTRovKA.s['81']++;return Y.Attribute.INVALID_VALUE;}else{__cov_QYITB_80n6ZEw3MrTRovKA.b['21'][1]++;}__cov_QYITB_80n6ZEw3MrTRovKA.s['82']++;var records=[],i,len;__cov_QYITB_80n6ZEw3MrTRovKA.s['83']++;for(i=0,len=items.length;i<len;++i){__cov_QYITB_80n6ZEw3MrTRovKA.s['84']++;records[i]=this._changeToRecord(items[i]);}__cov_QYITB_80n6ZEw3MrTRovKA.s['85']++;return this._items=records;}},{ATTRS:{records:{lazyAdd:false,getter:function(){__cov_QYITB_80n6ZEw3MrTRovKA.f['30']++;__cov_QYITB_80n6ZEw3MrTRovKA.s['86']++;return Y.Array(this._items);},setter:'_setRecords'},table:{valueFn:'_initHashTable'},key:{value:'id',readOnly:true}}});__cov_QYITB_80n6ZEw3MrTRovKA.s['87']++;Y.augment(Recordset,ArrayList);__cov_QYITB_80n6ZEw3MrTRovKA.s['88']++;Y.Recordset=Recordset;},'3.13.0',{'requires':['base','arraylist']});