public void setId(int id) {
        if (currentId > ids.length - 1) {
            int[] tmp = new int[ids.length];
            for (int i = 0; i < ids.length; i++) {
                tmp[i] = ids[i];
            }
            ids = new int[ids.length * 2];
            for (int i = 0; i < tmp.length; i ++) {
                ids[i] = tmp[i];
            }
        }
        ids[currentId] = id;
        currentId++;
    }