queue-base.js revision d2c45453b4a46a4be78ac4b2bae5f9a53b0bb125
/**
* The YUI module contains the components required for building the YUI seed file.
* This includes the script loading mechanism, a simple queue, and the core utilities for the library.
* @module yui
* @submodule yui-base
*/
/**
* A simple FIFO queue. Items are added to the Queue with add(1..n items) and
* removed using next().
*
* @class Queue
* @param item* {MIXED} 0..n items to seed the queue
*/
function Queue() {
this._init();
}
/**
* Initialize the queue
*
* @method _init
* @protected
*/
_init: function () {
/**
* The collection of enqueued items
*
* @property _q
* @type {Array}
* @protected
*/
this._q = [];
},
/**
* Get the next item in the queue. FIFO support
*
* @method next
* @return {MIXED} the next item in the queue
*/
next: function () {
},
/**
* Get the last in the queue. LIFO support
*
* @method last
* @return {MIXED} the last item in the queue
*/
last: function () {
},
/**
* Add 0..n items to the end of the queue
*
* @method add
* @param item* {MIXED} 0..n items
*/
add: function () {
},this);
return this;
},
/**
* Returns the current number of queued items
*
* @method size
* @return {Number}
*/
size: function () {
}
};