export default class Model{
    private arrDt:any[]
    constructor(arrDt:any[]){
        this.arrDt = arrDt;
    }
    getDataByID(id:number){
        for(let data of this.arrDt){
            if(data.id === id){
                return data;
            }
        }
        return null;
    }

    getDataByIndex(index:number){
        if(index <= 0 || index > this.arrDt.length - 1){
            return null;
        }
        return this.arrDt[index];
    }

    getSize(){
        return this.arrDt.length;
    }

}