public final class Printer
extends java.lang.Object
Constructor and Description |
---|
Printer(Options options,
ModelStateObserver observer,
Statistics statistics)
Constructs a printer object.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the generated file.
|
java.lang.String |
createNewFile() |
static java.lang.String |
getLastFileName() |
java.io.PrintWriter |
newFileWriter(java.lang.String fileName) |
void |
printCommentToFile(java.io.PrintWriter writer,
java.lang.String text) |
void |
printCommentToFile(java.lang.String text)
Prints a comment to the file.
|
void |
printHeaderToFile(java.lang.String text)
Prints a special header comment that specifies the start of a code section
(sections include: data definitions, initialization, finalization and main code).
|
void |
printSeparatorToFile()
Prints a special comment (a line of '*' characters) to the file to
separate different parts of the code.
|
void |
printSeparatorToFile(java.lang.String text)
Prints a special comment to the file to separate different parts of the code.
|
void |
printSequence(java.io.PrintWriter writer,
TestSequence sequence) |
void |
printSequence(TestSequence sequence)
Prints the specified instruction call sequence.
|
void |
printSubheaderToFile(java.lang.String text)
Prints a special header comment that specifies the start of a logically separate
part of code.
|
void |
printText(java.lang.String text)
Prints text both to the file and to the screen (if corresponding options are enabled).
|
void |
printTextNoIndent(java.lang.String text)
Prints text with no indent both to the file and to the screen (if corresponding options are
enabled).
|
void |
printToFile(java.io.PrintWriter writer,
java.lang.String text) |
void |
printToFile(java.lang.String text) |
void |
printToFileNoIndent(java.lang.String text) |
void |
printToScreen(java.lang.String text) |
public Printer(Options options, ModelStateObserver observer, Statistics statistics)
observer
- Model state observer to evaluate outputs.java.lang.IllegalArgumentException
- if the observer or commentToken parameter is null.java.io.IOException
- if failed to open the specified file for writing.public java.lang.String createNewFile() throws java.io.IOException
java.io.IOException
public java.io.PrintWriter newFileWriter(java.lang.String fileName) throws java.io.IOException
java.io.IOException
public void printSequence(TestSequence sequence) throws ConfigurationException
sequence
- Instruction call sequence.java.lang.NullPointerException
- if the parameter is null.ConfigurationException
- if failed to evaluate one of the output objects associated with
an instruction call in the sequence.public void printSequence(java.io.PrintWriter writer, TestSequence sequence) throws ConfigurationException
ConfigurationException
public void close()
public void printText(java.lang.String text)
text
- Text to be printed.public void printTextNoIndent(java.lang.String text)
text
- Text to be printed.public void printHeaderToFile(java.lang.String text)
text
- Text of the header.public void printSubheaderToFile(java.lang.String text)
text
- Text of the header.public void printCommentToFile(java.lang.String text)
text
- Text of the comment to be printed.public void printCommentToFile(java.io.PrintWriter writer, java.lang.String text)
public void printSeparatorToFile()
public void printSeparatorToFile(java.lang.String text)
text
- Text of the separator.public void printToScreen(java.lang.String text)
public void printToFile(java.lang.String text)
public void printToFile(java.io.PrintWriter writer, java.lang.String text)
public void printToFileNoIndent(java.lang.String text)
public static java.lang.String getLastFileName()