Class Output


  • public final class Output
    extends java.lang.Object
    The Output class holds information to be printed to the simulation output to inserted into the generated test program. The important attributes are:
    1. Runtime. Specifies whether the information is evaluated at the simulation time and goes to the simulator log or evaluated after simulation and inserted to the generated test program.
    2. Comment. Specifies whether the printed text is a comment.
    3. Format string. Used to describe the format of the text to be printed.
    4. Format arguments. Pieces of information to be inserted into the printed text.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Output.Kind
      The Output.Kind enum describes the type of the output.
    • Constructor Summary

      Constructors 
      Constructor Description
      Output​(Output other)
      Constructs a copy of an Output object.
      Output​(Output.Kind kind, java.lang.String format)
      Constructs an output object with no format arguments.
      Output​(Output.Kind kind, java.lang.String format, java.util.List<ru.ispras.microtesk.test.template.Output.Argument> args)
      Constructs an output object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<Output> copyAll​(java.util.List<Output> outputs)  
      java.lang.String evaluate​(Model model)
      Evaluates the stored information using the model state observer to read the state of the model (if required) and returns resulting text.
      Output.Kind getKind()
      Returns the output kind.
      boolean isComment()  
      boolean isRuntime()
      Returns true if the stored information should be evaluated during the simulation and the evaluation results should be printed to the MicroTESK simulator output or false if it should be evaluated after simulation and the results should be inserted into the generated test program.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Output

        public Output​(Output.Kind kind,
                      java.lang.String format,
                      java.util.List<ru.ispras.microtesk.test.template.Output.Argument> args)
        Constructs an output object.
        Parameters:
        kind - Output type.
        format - Format string.
        args - Format arguments.
      • Output

        public Output​(Output.Kind kind,
                      java.lang.String format)
        Constructs an output object with no format arguments.
        Parameters:
        kind - Output type.
        format - Format string.
      • Output

        public Output​(Output other)
        Constructs a copy of an Output object.
        Parameters:
        other - Object to be copied.
    • Method Detail

      • getKind

        public Output.Kind getKind()
        Returns the output kind.
        Returns:
        Output kind.
      • isRuntime

        public boolean isRuntime()
        Returns true if the stored information should be evaluated during the simulation and the evaluation results should be printed to the MicroTESK simulator output or false if it should be evaluated after simulation and the results should be inserted into the generated test program.
        Returns:
        true if it is to printed at runtime or false if it should be printed into the test program.
      • isComment

        public boolean isComment()
      • evaluate

        public java.lang.String evaluate​(Model model)
                                  throws ConfigurationException
        Evaluates the stored information using the model state observer to read the state of the model (if required) and returns resulting text.
        Parameters:
        model - Microprocessor model.
        Returns:
        Text to be printed.
        Throws:
        ConfigurationException - if failed to evaluate the information due to an incorrect request to the model state observer.
        java.lang.IllegalArgumentException - if the parameter equals null.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • copyAll

        public static java.util.List<Output> copyAll​(java.util.List<Output> outputs)