Class Output
java.lang.Object
java.io.OutputStream
com.ibm.jvm.dtfjview.Output
- All Implemented Interfaces:
IOutputChannel
,IOutputManager
,Closeable
,Flushable
,AutoCloseable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChannel
(IOutputChannel channel) Adds a channel to the list of registered channels.void
addChannel
(IOutputChannel channel, boolean printLastInput) void
Clears the current buffer contents.void
close()
Closes this output stream and releases any system resources associated with this stream.void
flush()
Flushes this output stream and forces any buffered output bytes to be written out.Gets the current buffer contents.Creates a print stream for this output objectvoid
Sends text to channelvoid
Sends text to the channel with an appended \nvoid
printPrompt
(String prompt) Sets the prompt which should be displayed when an interactive session is running.void
Remove all registered channelsvoid
removeChannel
(IOutputChannel channel) Removes a specific channel for a particular type.void
removeChannel
(Class<?> type) Removes all registered channels for a particular type.void
void
setBuffering
(boolean enabled) Enabling buffering will cause the output from commands to be written to an internal buffer rather than immediately to the underlying output channels.void
setConsoleNoPrint
(boolean noPrint) void
write
(int b) Writes the specified byte to this output stream.Methods declared in class java.io.OutputStream
nullOutputStream, write, write
-
Constructor Details
-
Output
public Output()
-
-
Method Details
-
clearBuffer
public void clearBuffer()Description copied from interface:IOutputManager
Clears the current buffer contents.- Specified by:
clearBuffer
in interfaceIOutputManager
-
setBuffering
public void setBuffering(boolean enabled) Description copied from interface:IOutputManager
Enabling buffering will cause the output from commands to be written to an internal buffer rather than immediately to the underlying output channels. This is typically used by clients to inspect or intercept the results from a command before carrying out further processing. By default buffering is not enabled.- Specified by:
setBuffering
in interfaceIOutputManager
- Parameters:
enabled
- true turns on buffering
-
getBuffer
Description copied from interface:IOutputManager
Gets the current buffer contents.- Specified by:
getBuffer
in interfaceIOutputManager
- Returns:
- buffer contents
-
print
Description copied from interface:IOutputChannel
Sends text to channel- Specified by:
print
in interfaceIOutputChannel
- Parameters:
outputString
- text to send
-
printPrompt
Description copied from interface:IOutputChannel
Sets the prompt which should be displayed when an interactive session is running. Typically this will display the context number in a multi-context environment.- Specified by:
printPrompt
in interfaceIOutputChannel
- Parameters:
prompt
- prompt to display.
-
println
Description copied from interface:IOutputChannel
Sends text to the channel with an appended \n- Specified by:
println
in interfaceIOutputChannel
- Parameters:
outputString
- text to send
-
addChannel
Description copied from interface:IOutputManager
Adds a channel to the list of registered channels.- Specified by:
addChannel
in interfaceIOutputManager
- Parameters:
channel
- channel to add.
-
addChannel
-
removeChannel
Description copied from interface:IOutputManager
Removes all registered channels for a particular type.- Specified by:
removeChannel
in interfaceIOutputManager
- Parameters:
type
-
-
removeChannel
Description copied from interface:IOutputManager
Removes a specific channel for a particular type. For this to be successful the underlying implementation must override hashcode and equals.- Specified by:
removeChannel
in interfaceIOutputManager
-
removeAllChannels
public void removeAllChannels()Description copied from interface:IOutputManager
Remove all registered channels- Specified by:
removeAllChannels
in interfaceIOutputManager
-
removeFileChannel
public void removeFileChannel() -
setConsoleNoPrint
public void setConsoleNoPrint(boolean noPrint) -
close
public void close()Description copied from class:java.io.OutputStream
Closes this output stream and releases any system resources associated with this stream. The general contract ofclose
is that it closes the output stream. A closed stream cannot perform output operations and cannot be reopened.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceIOutputChannel
- Overrides:
close
in classOutputStream
-
write
Description copied from class:java.io.OutputStream
Writes the specified byte to this output stream. The general contract forwrite
is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argumentb
. The 24 high-order bits ofb
are ignored.- Specified by:
write
in classOutputStream
- Parameters:
b
- thebyte
.- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
flush
public void flush()Description copied from class:java.io.OutputStream
Flushes this output stream and forces any buffered output bytes to be written out. The general contract offlush
is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in interfaceIOutputChannel
- Overrides:
flush
in classOutputStream
-
getPrintStream
Description copied from interface:IOutputManager
Creates a print stream for this output object- Specified by:
getPrintStream
in interfaceIOutputManager
- Returns:
-