package be.iminds.ilabt.jfed.highlevel.jobs;

import be.iminds.ilabt.jfed.experiment.tasks.ExperimentTaskStatus;

/**
 * User: twalcari
 * Date: 1/19/2016
 * Time: 10:50
 */
class StateSliceThread<S extends StateSlice> extends Thread {
    private final S stateSlice;

    StateSliceThread(S stateSlice, String stateName) {
        this.stateSlice = stateSlice;

        setName(stateName + "#" + stateSlice.getName());
    }

    @Override
    public void run() {
        stateSlice.call();
    }

    public ExperimentTaskStatus getResult() {
        return stateSlice.getResult();
    }

    public S getStateSlice() {
        return stateSlice;
    }
}
