package _VisualDVM.TestingSystem.DVM.DVMPackage;
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMCompilationTask;
import _VisualDVM.TestingSystem.DVM.DVMTasks.DVMRunTask;
import com.google.gson.annotations.Expose;

import java.io.Serializable;
import java.util.List;
import java.util.Vector;
public class DVMPackage_json implements Serializable {
    @Expose
    public int max_task_id = 0;
    @Expose
    public List<DVMCompilationTask> compilationTasks = new Vector<>();
    public int getMaxTaskId() {
        return max_task_id++;
    }
    public DVMPackage_json(){}
    public DVMPackage_json(List<DVMCompilationTask> tasks){
        for (DVMCompilationTask compilationTask : tasks) {
            compilationTask.id = getMaxTaskId();
            //-
            for (DVMRunTask runTask : compilationTask.runTasks) {
                runTask.id = getMaxTaskId();
                runTask.dvmcompilationtask_id = compilationTask.id;
            }
        }
        compilationTasks.addAll(tasks);
    }
}
