Class SimulationResult.Builder

  • Enclosing class:
    SimulationResult

    public static class SimulationResult.Builder
    extends Object
    Mutable builder for SimulationResult instances.
    • Constructor Detail

      • Builder

        public Builder()
    • 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