var Queue = Class.create();

Queue.prototype = {
	collection: null,
	
	initialize: function() {
		this.collection = new Array();
	},
	
	add: function(object) {
		this.collection.push(object);
	},
	
	remove: function() {
		this.collection.shift();
	},
	
	front: function() {
		if (this.collection.size() > 0) {
			return this.collection[0];
		}
		return null;
	},
	
	rear: function() {
		if (this.collection.size() > 0) {
			return this.collection[this.collection.size()-1];
		}
		return null;		
	},
	
	size: function() {
		return this.collection.size();
	},
	
	contains: function(object) {
		var length = this.collection.size();
		for (var index = 0; index < length; index++) {
			if (this.collection[index].id == object.id) {
				return true;
			}
		}
		return false;
	}	
};
