Class SimulationResult.Builder
- java.lang.Object
-
- com.tonic.analysis.simulation.core.SimulationResult.Builder
-
- Enclosing class:
- SimulationResult
public static class SimulationResult.Builder extends Object
Mutable builder for SimulationResult instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimulationResult.BuilderaddState(StateSnapshot state)Records a state snapshot, indexing it by block and folding its max stack depth into the running maximum.SimulationResultbuild()Builds the immutable result from the recorded data.SimulationResult.BuildermaxStackDepth(int depth)Raises the recorded maximum stack depth; a value below the current maximum is ignored.SimulationResult.Buildermethod(IRMethod method)Sets the method the result describes.SimulationResult.BuildersimulationTime(long nanos)Sets the simulation wall time.SimulationResult.BuildertotalInstructions(int count)Sets the total number of instructions simulated.
-
-
-
Method Detail
-
method
public SimulationResult.Builder method(IRMethod method)
Sets the method the result describes.- Parameters:
method- the simulated method- Returns:
- this builder
-
addState
public SimulationResult.Builder addState(StateSnapshot state)
Records a state snapshot, indexing it by block and folding its max stack depth into the running maximum.- Parameters:
state- the snapshot to record- Returns:
- this builder
-
totalInstructions
public SimulationResult.Builder totalInstructions(int count)
Sets the total number of instructions simulated.- Parameters:
count- the instruction count- Returns:
- this builder
-
maxStackDepth
public SimulationResult.Builder maxStackDepth(int depth)
Raises the recorded maximum stack depth; a value below the current maximum is ignored.- Parameters:
depth- the observed stack depth- Returns:
- this builder
-
simulationTime
public SimulationResult.Builder simulationTime(long nanos)
Sets the simulation wall time.- Parameters:
nanos- the elapsed time in nanoseconds- Returns:
- this builder
-
build
public SimulationResult build()
Builds the immutable result from the recorded data.- Returns:
- a new SimulationResult
-
-