/* automatically generated by JSCoverage - do not edit */
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
if (! _$jscoverage['collections/Stack.js']) {
  _$jscoverage['collections/Stack.js'] = [];
  _$jscoverage['collections/Stack.js'][1] = 0;
  _$jscoverage['collections/Stack.js'][15] = 0;
  _$jscoverage['collections/Stack.js'][20] = 0;
  _$jscoverage['collections/Stack.js'][21] = 0;
  _$jscoverage['collections/Stack.js'][30] = 0;
  _$jscoverage['collections/Stack.js'][38] = 0;
  _$jscoverage['collections/Stack.js'][39] = 0;
  _$jscoverage['collections/Stack.js'][40] = 0;
  _$jscoverage['collections/Stack.js'][41] = 0;
  _$jscoverage['collections/Stack.js'][42] = 0;
  _$jscoverage['collections/Stack.js'][44] = 0;
  _$jscoverage['collections/Stack.js'][53] = 0;
  _$jscoverage['collections/Stack.js'][54] = 0;
  _$jscoverage['collections/Stack.js'][55] = 0;
  _$jscoverage['collections/Stack.js'][57] = 0;
  _$jscoverage['collections/Stack.js'][64] = 0;
  _$jscoverage['collections/Stack.js'][65] = 0;
  _$jscoverage['collections/Stack.js'][75] = 0;
  _$jscoverage['collections/Stack.js'][85] = 0;
  _$jscoverage['collections/Stack.js'][86] = 0;
  _$jscoverage['collections/Stack.js'][87] = 0;
  _$jscoverage['collections/Stack.js'][88] = 0;
  _$jscoverage['collections/Stack.js'][90] = 0;
  _$jscoverage['collections/Stack.js'][91] = 0;
  _$jscoverage['collections/Stack.js'][93] = 0;
  _$jscoverage['collections/Stack.js'][95] = 0;
  _$jscoverage['collections/Stack.js'][100] = 0;
  _$jscoverage['collections/Stack.js'][104] = 0;
  _$jscoverage['collections/Stack.js'][108] = 0;
}
_$jscoverage['collections/Stack.js'][1]++;
var define = require("../define").define, Collection = require("./Collection"), base = require("../base");
_$jscoverage['collections/Stack.js'][15]++;
module.exports = exports = define(Collection, {instance: {constructor: (function () {
  _$jscoverage['collections/Stack.js'][20]++;
  this.__stack = [];
  _$jscoverage['collections/Stack.js'][21]++;
  this.__next = -1;
}), push: (function (data) {
  _$jscoverage['collections/Stack.js'][30]++;
  this.__stack[++this.__next] = data;
}), pop: (function () {
  _$jscoverage['collections/Stack.js'][38]++;
  var ret = undefined, stack, next = this.__next;
  _$jscoverage['collections/Stack.js'][39]++;
  if (next >= 0) {
    _$jscoverage['collections/Stack.js'][40]++;
    stack = this.__stack;
    _$jscoverage['collections/Stack.js'][41]++;
    ret = stack[next];
    _$jscoverage['collections/Stack.js'][42]++;
    stack[this.__next--] = undefined;
  }
  _$jscoverage['collections/Stack.js'][44]++;
  return ret;
}), peek: (function () {
  _$jscoverage['collections/Stack.js'][53]++;
  var ret = undefined, next = this.__next;
  _$jscoverage['collections/Stack.js'][54]++;
  if (next >= 0) {
    _$jscoverage['collections/Stack.js'][55]++;
    ret = this.__stack[next];
  }
  _$jscoverage['collections/Stack.js'][57]++;
  return ret;
}), clear: (function () {
  _$jscoverage['collections/Stack.js'][64]++;
  this.__stack.length = 0;
  _$jscoverage['collections/Stack.js'][65]++;
  this.__next = -1;
}), contains: (function (obj) {
  _$jscoverage['collections/Stack.js'][75]++;
  return this.__stack.indexOf(obj) != -1;
}), remove: (function (obj) {
  _$jscoverage['collections/Stack.js'][85]++;
  var index = this.__stack.indexOf(obj), ret = false;
  _$jscoverage['collections/Stack.js'][86]++;
  if (index != -1) {
    _$jscoverage['collections/Stack.js'][87]++;
    if (index == this.__next) {
      _$jscoverage['collections/Stack.js'][88]++;
      this.pop();
    }
    else {
      _$jscoverage['collections/Stack.js'][90]++;
      this.__stack.splice(index, 1);
      _$jscoverage['collections/Stack.js'][91]++;
      this.__next--;
    }
    _$jscoverage['collections/Stack.js'][93]++;
    ret = true;
  }
  _$jscoverage['collections/Stack.js'][95]++;
  return ret;
}), getters: {count: (function () {
  _$jscoverage['collections/Stack.js'][100]++;
  return this.__next + 1;
}), isEmpty: (function () {
  _$jscoverage['collections/Stack.js'][104]++;
  return this.__next < 0;
}), values: (function () {
  _$jscoverage['collections/Stack.js'][108]++;
  return this.__stack.slice(0, this.__next + 1).reverse();
})}}});
_$jscoverage['collections/Stack.js'].source = ["var define = require(\"../define\").define,","        Collection = require(\"./Collection\"),","        base = require(\"../base\");","","/**"," * @class &lt;p&gt;LIFO Data structure&lt;/p&gt;"," * @name Stack"," * @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.Stack.prototype*/","","        constructor : function() {","            this.__stack = [];","            this.__next = -1;","        },","","        /**","         * Add an item to the tail of this stack","         * @param {*} data item to qppend to this stack","         *","         */","        push : function(data) {","            this.__stack[++this.__next] = data;","        },","","        /**","         * Removes the tail of this static","         * @return {*} the data at the tail of this stack","         */","        pop : function() {","            var ret = undefined, stack, next = this.__next;","            if (next &gt;= 0) {","                stack = this.__stack;","                ret = stack[next];","                stack[this.__next--] = undefined;","            }","            return ret;","        },","","        /**","         * Retrieves the item at the tail of the stack without removing it","         *","         * @return {*} The element at the tail of the stack. Returns undefined if the stack is empty.","         */","        peek : function() {","            var ret = undefined,next = this.__next;","            if (next &gt;= 0) {","                ret = this.__stack[next];","            }","            return ret;","        },","","         /**","         * Removes all items from this stack.","         */","        clear : function() {","            this.__stack.length = 0;","            this.__next = -1;","        },","","        /**","         * Determine if this stack contains the element","         * @param {*} obj the object to find","         *","         * @return {Boolean} true if this stack contains the element","         */","        contains : function(obj) {","            return this.__stack.indexOf(obj) != -1;","        },","","        /**","         * Removes an element from this stack.","         * @param {*} obj the data to remove.","         *","         * @return {Boolean} true if the element was removed, false otherwise.","         */","        remove : function(obj) {","            var index = this.__stack.indexOf(obj), ret = false;","            if (index != -1) {","                if (index == this.__next) {","                    this.pop();","                } else {","                    this.__stack.splice(index, 1);","                    this.__next--;","                }","                ret = true;","            }","            return ret;","        },","","        getters : {","            count : function() {","                return this.__next + 1;","            },","","            isEmpty : function() {","                return this.__next &lt; 0;","            },","","            values : function() {","                return this.__stack.slice(0, this.__next + 1).reverse();","            }","        }","    }","});"];
