/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['collections/Queue.js']) {
  _$jscoverage['collections/Queue.js'] = [];
  _$jscoverage['collections/Queue.js'][1] = 0;
  _$jscoverage['collections/Queue.js'][15] = 0;
  _$jscoverage['collections/Queue.js'][20] = 0;
  _$jscoverage['collections/Queue.js'][21] = 0;
  _$jscoverage['collections/Queue.js'][22] = 0;
  _$jscoverage['collections/Queue.js'][30] = 0;
  _$jscoverage['collections/Queue.js'][39] = 0;
  _$jscoverage['collections/Queue.js'][40] = 0;
  _$jscoverage['collections/Queue.js'][41] = 0;
  _$jscoverage['collections/Queue.js'][42] = 0;
  _$jscoverage['collections/Queue.js'][43] = 0;
  _$jscoverage['collections/Queue.js'][45] = 0;
  _$jscoverage['collections/Queue.js'][54] = 0;
  _$jscoverage['collections/Queue.js'][55] = 0;
  _$jscoverage['collections/Queue.js'][56] = 0;
  _$jscoverage['collections/Queue.js'][58] = 0;
  _$jscoverage['collections/Queue.js'][65] = 0;
  _$jscoverage['collections/Queue.js'][66] = 0;
  _$jscoverage['collections/Queue.js'][67] = 0;
  _$jscoverage['collections/Queue.js'][77] = 0;
  _$jscoverage['collections/Queue.js'][86] = 0;
  _$jscoverage['collections/Queue.js'][87] = 0;
  _$jscoverage['collections/Queue.js'][88] = 0;
  _$jscoverage['collections/Queue.js'][89] = 0;
  _$jscoverage['collections/Queue.js'][91] = 0;
  _$jscoverage['collections/Queue.js'][92] = 0;
  _$jscoverage['collections/Queue.js'][94] = 0;
  _$jscoverage['collections/Queue.js'][96] = 0;
  _$jscoverage['collections/Queue.js'][101] = 0;
  _$jscoverage['collections/Queue.js'][105] = 0;
  _$jscoverage['collections/Queue.js'][109] = 0;
}
_$jscoverage['collections/Queue.js'][1]++;
var define = require("../define").define, Collection = require("./Collection"), base = require("../base");
_$jscoverage['collections/Queue.js'][15]++;
module.exports = exports = define(Collection, {instance: {constructor: (function () {
  _$jscoverage['collections/Queue.js'][20]++;
  this.__queue = [];
  _$jscoverage['collections/Queue.js'][21]++;
  this.__next = 0;
  _$jscoverage['collections/Queue.js'][22]++;
  this.__last = 0;
}), enqueue: (function (data) {
  _$jscoverage['collections/Queue.js'][30]++;
  this.__queue[this.__last++] = data;
}), dequeue: (function () {
  _$jscoverage['collections/Queue.js'][39]++;
  var ret = undefined, next = this.__next, queue;
  _$jscoverage['collections/Queue.js'][40]++;
  if (next != this.__last) {
    _$jscoverage['collections/Queue.js'][41]++;
    queue = this.__queue;
    _$jscoverage['collections/Queue.js'][42]++;
    ret = queue[next];
    _$jscoverage['collections/Queue.js'][43]++;
    queue[this.__next++] = undefined;
  }
  _$jscoverage['collections/Queue.js'][45]++;
  return ret;
}), peek: (function () {
  _$jscoverage['collections/Queue.js'][54]++;
  var ret = undefined, next = this.__next;
  _$jscoverage['collections/Queue.js'][55]++;
  if (next != this.__last) {
    _$jscoverage['collections/Queue.js'][56]++;
    ret = this.__queue[next];
  }
  _$jscoverage['collections/Queue.js'][58]++;
  return ret;
}), clear: (function () {
  _$jscoverage['collections/Queue.js'][65]++;
  this.__queue.length = 0;
  _$jscoverage['collections/Queue.js'][66]++;
  this.__next = 0;
  _$jscoverage['collections/Queue.js'][67]++;
  this.__last = 0;
}), contains: (function (obj) {
  _$jscoverage['collections/Queue.js'][77]++;
  return this.__queue.indexOf(obj) != -1;
}), remove: (function (obj) {
  _$jscoverage['collections/Queue.js'][86]++;
  var index = this.__queue.indexOf(obj), ret = false;
  _$jscoverage['collections/Queue.js'][87]++;
  if (index != -1) {
    _$jscoverage['collections/Queue.js'][88]++;
    if (index == this.__next) {
      _$jscoverage['collections/Queue.js'][89]++;
      this.dequeue();
    }
    else {
      _$jscoverage['collections/Queue.js'][91]++;
      this.__queue.splice(index, 1);
      _$jscoverage['collections/Queue.js'][92]++;
      this.__last--;
    }
    _$jscoverage['collections/Queue.js'][94]++;
    ret = true;
  }
  _$jscoverage['collections/Queue.js'][96]++;
  return ret;
}), getters: {count: (function () {
  _$jscoverage['collections/Queue.js'][101]++;
  return this.__last - this.__next;
}), isEmpty: (function () {
  _$jscoverage['collections/Queue.js'][105]++;
  return this.__last - this.__next == 0;
}), values: (function () {
  _$jscoverage['collections/Queue.js'][109]++;
  return this.__queue.slice(this.__next, this.__last);
})}}});
_$jscoverage['collections/Queue.js'].source = ["var define = require(\"../define\").define,","        Collection = require(\"./Collection\"),","        base = require(\"../base\");","","/**"," * @class &lt;p&gt;FIFO Data structure&lt;/p&gt;"," * @name Queue"," * @augments comb.collections.Collection"," * @memberOf comb.collections"," *"," * @property {Number} count the current number of elements in this queue"," * @property {Boolean} isEmpty true if this queue is empty"," * @property {Array} values a copy of the values contained in this queue"," */","module.exports = exports = define(Collection, {","    instance : {","        /**@lends comb.collections.Queue.prototype*/","","        constructor : function() {","            this.__queue = [];","            this.__next = 0;","            this.__last = 0;","        },","","        /**","         * Add data to this queue","         * @param {*} data element to add","         */","        enqueue : function(data) {","            this.__queue[this.__last++] = data;","        },","","        /**","         * Removes first item from the head of the queue","         *","         * @return {*} The element removed from this queue. Returns undefined if the queue is empty.","         */","        dequeue : function() {","            var ret = undefined,next = this.__next, queue;","            if (next != this.__last) {","                queue = this.__queue;","                ret = queue[next];","                queue[this.__next++] = undefined;","            }","            return ret;","        },","","        /**","         * Retrieves the item at the head of the queue without removing it","         *","         * @return {*} The element at the head of the queue. Returns undefined if the queue is empty.","         */","        peek : function() {","            var ret = undefined, next = this.__next;","            if (next != this.__last) {","                ret = this.__queue[next];","            }","            return ret;","        },","","        /**","         * Removes all items from this queue","         */","        clear : function() {","            this.__queue.length = 0;","            this.__next = 0;","            this.__last = 0;","        },","","        /**","         * Determine if this queue contains the element","         * @param {*} obj the object to find","         *","         * @return {Boolean} true if this queue contains the element","         */","        contains : function(obj) {","            return this.__queue.indexOf(obj) != -1;","        },","        /**","         * Removes an element from this queue.","         * @param {*} obj the data to remove.","         *","         * @return {Boolean} true if the element was removed, false otherwise.","         */","        remove : function(obj) {","            var index = this.__queue.indexOf(obj), ret = false;","            if (index != -1) {","                if (index == this.__next) {","                    this.dequeue();","                } else {","                    this.__queue.splice(index, 1);","                    this.__last--;","                }","                ret = true;","            }","            return ret;","        },","","        getters : {","            count : function() {","                return this.__last - this.__next;","            },","","            isEmpty : function() {","                return this.__last - this.__next == 0;","            },","","            values : function() {","                return this.__queue.slice(this.__next, this.__last);","            }","        }","    }","});"];
