Class Output
- java.lang.Object
-
- ru.ispras.microtesk.test.template.Output
-
public final class Output extends java.lang.Object
TheOutput
class holds information to be printed to the simulation output to inserted into the generated test program. The important attributes are:- 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.
- Comment. Specifies whether the printed text is a comment.
- Format string. Used to describe the format of the text to be printed.
- 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
TheOutput.Kind
enum describes the type of the output.
-
Constructor Summary
Constructors Constructor Description Output(Output other)
Constructs a copy of anOutput
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()
Returnstrue
if the stored information should be evaluated during the simulation and the evaluation results should be printed to the MicroTESK simulator output orfalse
if it should be evaluated after simulation and the results should be inserted into the generated test program.java.lang.String
toString()
-
-
-
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.
-
-
Method Detail
-
getKind
public Output.Kind getKind()
Returns the output kind.- Returns:
- Output kind.
-
isRuntime
public boolean isRuntime()
Returnstrue
if the stored information should be evaluated during the simulation and the evaluation results should be printed to the MicroTESK simulator output orfalse
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 orfalse
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 equalsnull
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-