Package adams.core.management
Class RecordingOutputPrinter
- java.lang.Object
-
- adams.core.management.AbstractOutputPrinter
-
- adams.core.management.DefaultOutputPrinter
-
- adams.core.management.LoggingObjectOutputPrinter
-
- adams.core.management.RecordingOutputPrinter
-
- All Implemented Interfaces:
LoggingObjectOwner
public class RecordingOutputPrinter extends LoggingObjectOutputPrinter
Output printer that records the output.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected StringBuilderm_Bufferthe buffer for recording the output.-
Fields inherited from class adams.core.management.LoggingObjectOutputPrinter
m_Owner
-
Fields inherited from class adams.core.management.AbstractOutputPrinter
m_ID, m_Reader, m_StdOut
-
-
Constructor Summary
Constructors Constructor Description RecordingOutputPrinter(boolean stdout, Process process)Initializes the printer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRecording()Returns the recorded output.protected voidinitialize(boolean stdout, Process process)Initializes the printer.protected voidoutput(String line)Outputs the specified line.-
Methods inherited from class adams.core.management.LoggingObjectOutputPrinter
getOwner, setOwner, toString
-
Methods inherited from class adams.core.management.AbstractOutputPrinter
getID, isStdOut, process, read
-
-
-
-
Field Detail
-
m_Buffer
protected StringBuilder m_Buffer
the buffer for recording the output.
-
-
Constructor Detail
-
RecordingOutputPrinter
public RecordingOutputPrinter(boolean stdout, Process process)Initializes the printer.- Parameters:
stdout- whether to use stdout or stderrprocess- the process to monitor
-
-
Method Detail
-
initialize
protected void initialize(boolean stdout, Process process)Initializes the printer.- Overrides:
initializein classLoggingObjectOutputPrinter- Parameters:
stdout- whether to use stdout or stderrprocess- the process to monitor
-
output
protected void output(String line)
Outputs the specified line.- Overrides:
outputin classLoggingObjectOutputPrinter- Parameters:
line- the text to output
-
getRecording
public String getRecording()
Returns the recorded output.- Returns:
- the output
-
-