/**
 * Listat megvalosito objektum
 */
function List (){
    
    this.datas = new Array ();

    this.size = function (){
        return this.datas.length;
    };

    this.get = function ( index ){
        return this.datas[index];
    };

    this.getIndex = function ( obj ){
        for ( var i = 0; i < this.datas.length; i++ ){
            if ( this.datas[i] == obj ){
                return i;
            }
        }
        return -1;
    };

    this.contains = function ( obj ){
        return this.getIndex(obj) != -1;
    };

    this.clear = function (){
        this.datas = new Array();
    };

    this.add = function ( obj ){
        this.datas[this.datas.length] = obj;
    };

    this.removeByElement = function ( obj ){
        this.removeByIndex ( this.getIndex ( obj ) );
    };

    this.removeByIndex = function ( index ){
        var newDatas = new Array ();
        for ( var i = 0; i < this.datas.length; i++ ){
            if ( i != index ){
                newDatas[newDatas.length] = this.datas[i];
            }
        }
        this.datas = newDatas;
    };

    this.removeAll = function (){
        this.clear();
    }
}
