function Collection() {
    var coll = new Array();
    
    coll.get = collection_get;
    coll.add = collection_add;
    coll.set = collection_set;
    coll.remove = collection_remove;
    coll.contains = collection_contains;
    coll.position = collection_position;
    coll.size = collection_size;
    coll.isEmpty = collection_is_empty;
    coll.clear = collection_clear;
    
    return coll;
}

function collection_get() {
    return this[arguments[0]]; 
}

function collection_add() {
    this[this.length] = arguments[0];
}

function collection_set() {
    this[arguments[0]] = arguments[1];
}

function collection_remove() {
    this.splice(arguments[0], 1);
}

function collection_clear() {
    this.length = 0;
}

function collection_size() {
    return this.length;
}


function collection_is_empty() {
    return this.length == 0;
}

function collection_contains(){
    for (var i=0; i<this.length; i++) {
        if (this[i] == arguments[0]) {
            return true;
        }
    }
        
    return false;
}

function collection_position(){
    for (var i=0; i<this.length; i++) {
        if (this[i] == arguments[0]) {
            return i;
        }
    }
        
    return -1;
}
