var list = new Array();
/**
* Add
* @param {Object} object
*/
function add(object) {
list[list.length] = object;
}
/**
* Remove the element at the specified position from this list.
* @param index specifies the position
* @return the element at this position
*/
function removeIndex(index) {
var object = this.list[index];
this.list.splice(index, 1);
return object;
}
/**
* Remove the specified element from this list.
* @param object specified element
* @return element at this position
*/
function remove(object) {
var i = 0;
for (; i < list.length; i ) {
if (list[i] === object) {
break;
}
}
if (i >= list.length) {
return null;
} else {
return removeIndex(i);
}
}
/**
* Get the specified element in the list.
* @param object specified element
* @return element at this position
*/
function get(index) {
return list[index];
}
/**
* Remove all elements from this list.
*/
function removeAll() {
list.splice(0, list.length);
}
/**
* Returns the number of elements in this list.
* @return the number of elements
*/
function size () {
return this.list.length;
}
/**
* Returns true if the list contains no elements.
* @return true or false
*/
function isEmpty() {
return list.length == 0;
}