// Path: implementations/java/OWAT-lib/src/main/java/com/ebp/owat/lib/datastructure/value/NodeMode.java
// public enum NodeMode {
// 	BIT(SerializationConstants.BIT_TYPE_STR, BitValue.class),BYTE(SerializationConstants.BYTE_TYPE_STR, ByteValue.class);
// 	
// 	public final String typeStr;
// 	public final Class<? extends Value> typeClass;
// 	
// 	NodeMode(String typeStr, Class<? extends Value> typeClass){
// 		this.typeStr = typeStr;
// 		this.typeClass = typeClass;
// 	}
// }
// 
// Path: implementations/java/OWAT-lib/src/main/java/com/ebp/owat/lib/runner/utils/Step.java
// public enum Step {
// 	NOT_STARTED_SCRAMBLE(0, "Not Started", ScrambleMode.SCRAMBLING),
// 	NOT_STARTED_DESCRAMBLE(0, "Not Started", ScrambleMode.DESCRAMBLING),
// 
// 	LOAD_DATA(1, "Loading Data", ScrambleMode.SCRAMBLING),
// 	PAD_DATA(2, "Padding Data", ScrambleMode.SCRAMBLING),
// 	SCRAMBLING(3, "Scrambling", ScrambleMode.SCRAMBLING),
// 	OUT_SCRAMBLED_DATA(4, "Outputting Scrambled Data", ScrambleMode.SCRAMBLING),
// 	OUT_KEY(5, "Outputting key", ScrambleMode.SCRAMBLING),
// 	DONE_SCRAMBLING(6, "Done", ScrambleMode.SCRAMBLING),
// 	
// 	LOAD_KEY(1, "Loading Key", ScrambleMode.DESCRAMBLING),
// 	LOAD_SCRAMBLED_DATA(2, "Loading Scrambled Data", ScrambleMode.DESCRAMBLING),
// 	DESCRAMBLING(3, "Descrambling", ScrambleMode.DESCRAMBLING),
// 	OUT_DESCRAMBLED_DATA(4, "Outputting Descrambled Data", ScrambleMode.DESCRAMBLING),
// 	DONE_DESCRAMBLING(5, "Done", ScrambleMode.DESCRAMBLING);
// 
// 	/** The step number of the step. */
// 	public final int stepNo;
// 	/** The name of the step. */
// 	public final String stepName;
// 	/** The mode the step is part of. */
// 	public final ScrambleMode mode;
// 	
// 	Step(int stepNo, String name, ScrambleMode mode){
// 		this.stepNo = stepNo;
// 		this.stepName = name;
// 		this.mode = mode;
// 	}
// 
// 	/**
// 	 * Gets the steps that are part of a mode.
// 	 * @param mode The mode to get the steps of
// 	 * @return The list of steps in the mode.
// 	 */
// 	public static List<Step> getStepsIn(ScrambleMode mode){
// 		List<Step> steps = new LinkedList<>();
// 
// 		for(Step curStep : Step.values()){
// 			if(
// 				curStep == NOT_STARTED_SCRAMBLE ||
// 				curStep == NOT_STARTED_DESCRAMBLE ||
// 				curStep == DONE_DESCRAMBLING ||
// 				curStep == DONE_SCRAMBLING
// 			){
// 				continue;
// 			}
// 			if(curStep.mode == mode){
// 				steps.add(curStep);
// 			}
// 		}
// 		return steps;
// 	}
// }


import com.ebp.owat.lib.datastructure.value.NodeMode;
import com.ebp.owat.lib.runner.utils.Step;
import static com.ebp.owat.lib.runner.utils.ScrambleMode.DESCRAMBLING;
package com.ebp.owat.lib.runner.utils.results;



/**
 * Represents the run results from descrambling.
 */
public class DescrambleResults extends RunResults {
	/**
	 * Base constructor.
	 */
	public DescrambleResults(){
		super(DESCRAMBLING);
	}

	/**
	 * Constructor to setup the node mode.
	 * @param nodeMode The node mode used.
	 */
	public DescrambleResults(NodeMode nodeMode){
		super(DESCRAMBLING, nodeMode);
	}

	@Override
	public synchronized DescrambleResults clone(){
		DescrambleResults output = new DescrambleResults(this.getNodeMode());
		output.setMatrixMode(this.getMatrixMode());
		output.setCurStep(this.getCurStep());
		output.setCurStepProgMax(this.getCurStepProgMax());
		output.setCurStepProg(this.getCurStepProg());
		output.setTimingMap(this.getTimingMap());
		output.setMatrixSize(this.getMatrixSize());
		output.setNumBytesIn(this.getNumBytesIn());
		output.setNumBytesOut(this.getNumBytesOut());

		return output;
	}

	/**
	 * Gets the CSV head used for descrambling data results.
	 * @return The CSV head used for descrambling data results.
	 */
	public static String getCsvHead(){
		StringBuilder sb = new StringBuilder(RunResults.getCsvHeadBase());

		for (Step curStep : Step.getStepsIn(DESCRAMBLING)) {
			sb.append(",");
			sb.append(curStep.stepName);
		}

		return sb.toString();
	}

// Path: implementations/java/OWAT-lib/src/main/java/com/ebp/owat/lib/datastructure/value/NodeMode.java
// public enum NodeMode {
// 	BIT(SerializationConstants.BIT_TYPE_STR, BitValue.class),BYTE(SerializationConstants.BYTE_TYPE_STR, ByteValue.class);
// 	
// 	public final String typeStr;
// 	public final Class<? extends Value> typeClass;
// 	
// 	NodeMode(String typeStr, Class<? extends Value> typeClass){
// 		this.typeStr = typeStr;
// 		this.typeClass = typeClass;
// 	}
// }
// 
// Path: implementations/java/OWAT-lib/src/main/java/com/ebp/owat/lib/runner/utils/Step.java
// public enum Step {
// 	NOT_STARTED_SCRAMBLE(0, "Not Started", ScrambleMode.SCRAMBLING),
// 	NOT_STARTED_DESCRAMBLE(0, "Not Started", ScrambleMode.DESCRAMBLING),
// 
// 	LOAD_DATA(1, "Loading Data", ScrambleMode.SCRAMBLING),
// 	PAD_DATA(2, "Padding Data", ScrambleMode.SCRAMBLING),
// 	SCRAMBLING(3, "Scrambling", ScrambleMode.SCRAMBLING),
// 	OUT_SCRAMBLED_DATA(4, "Outputting Scrambled Data", ScrambleMode.SCRAMBLING),
// 	OUT_KEY(5, "Outputting key", ScrambleMode.SCRAMBLING),
// 	DONE_SCRAMBLING(6, "Done", ScrambleMode.SCRAMBLING),
// 	
// 	LOAD_KEY(1, "Loading Key", ScrambleMode.DESCRAMBLING),
// 	LOAD_SCRAMBLED_DATA(2, "Loading Scrambled Data", ScrambleMode.DESCRAMBLING),
// 	DESCRAMBLING(3, "Descrambling", ScrambleMode.DESCRAMBLING),
// 	OUT_DESCRAMBLED_DATA(4, "Outputting Descrambled Data", ScrambleMode.DESCRAMBLING),
// 	DONE_DESCRAMBLING(5, "Done", ScrambleMode.DESCRAMBLING);
// 
// 	/** The step number of the step. */
// 	public final int stepNo;
// 	/** The name of the step. */
// 	public final String stepName;
// 	/** The mode the step is part of. */
// 	public final ScrambleMode mode;
// 	
// 	Step(int stepNo, String name, ScrambleMode mode){
// 		this.stepNo = stepNo;
// 		this.stepName = name;
// 		this.mode = mode;
// 	}
// 
// 	/**
// 	 * Gets the steps that are part of a mode.
// 	 * @param mode The mode to get the steps of
// 	 * @return The list of steps in the mode.
// 	 */
// 	public static List<Step> getStepsIn(ScrambleMode mode){
// 		List<Step> steps = new LinkedList<>();
// 
// 		for(Step curStep : Step.values()){
// 			if(
// 				curStep == NOT_STARTED_SCRAMBLE ||
// 				curStep == NOT_STARTED_DESCRAMBLE ||
// 				curStep == DONE_DESCRAMBLING ||
// 				curStep == DONE_SCRAMBLING
// 			){
// 				continue;
// 			}
// 			if(curStep.mode == mode){
// 				steps.add(curStep);
// 			}
// 		}
// 		return steps;
// 	}
// }


// Path: implementations/java/OWAT-lib/src/main/java/com/ebp/owat/lib/runner/utils/results/DescrambleResults.java
import com.ebp.owat.lib.datastructure.value.NodeMode;
import com.ebp.owat.lib.runner.utils.Step;
import static com.ebp.owat.lib.runner.utils.ScrambleMode.DESCRAMBLING;

package com.ebp.owat.lib.runner.utils.results;



/**
 * Represents the run results from descrambling.
 */
public class DescrambleResults extends RunResults {
	/**
	 * Base constructor.
	 */
	public DescrambleResults(){
		super(DESCRAMBLING);
	}

	/**
	 * Constructor to setup the node mode.
	 * @param nodeMode The node mode used.
	 */
	public DescrambleResults(NodeMode nodeMode){
		super(DESCRAMBLING, nodeMode);
	}

	@Override
	public synchronized DescrambleResults clone(){
		DescrambleResults output = new DescrambleResults(this.getNodeMode());
		output.setMatrixMode(this.getMatrixMode());
		output.setCurStep(this.getCurStep());
		output.setCurStepProgMax(this.getCurStepProgMax());
		output.setCurStepProg(this.getCurStepProg());
		output.setTimingMap(this.getTimingMap());
		output.setMatrixSize(this.getMatrixSize());
		output.setNumBytesIn(this.getNumBytesIn());
		output.setNumBytesOut(this.getNumBytesOut());

		return output;
	}

	/**
	 * Gets the CSV head used for descrambling data results.
	 * @return The CSV head used for descrambling data results.
	 */
	public static String getCsvHead(){
		StringBuilder sb = new StringBuilder(RunResults.getCsvHeadBase());

		for (Step curStep : Step.getStepsIn(DESCRAMBLING)) {
			sb.append(",");
			sb.append(curStep.stepName);
		}

		return sb.toString();
	}

	@Override