Package org.jcsp.plugNplay
Class Printer
java.lang.Object
org.jcsp.plugNplay.Printer
- All Implemented Interfaces:
CSProcess
Prints each Object from its input channel to a PrintStream.
Process Diagram
Description
Printer is a process for printing each object from its in channel to a PrintStream object (by default, System.out).For convenience, Printer may be configured with prefix and postfix strings with which to decorate its output.
Channel Protocols
Input Channels | ||
---|---|---|
in | java.lang.Object | The in Channel can accept data of any Class. |
Example
See the example inMerge
.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChannelInput
The channel from which to readprivate String
The string to write after each objectprivate String
The string to write in front of each objectprivate PrintStream
The stream to which to write -
Constructor Summary
ConstructorsConstructorDescriptionPrinter
(ChannelInput in) Construct a new Printer with System.out as its PrintStream and empty prefix and postfix strings.Printer
(ChannelInput in, PrintStream printStream) Construct a new Printer with empty prefix and postfix strings.Printer
(ChannelInput in, PrintStream printStream, String prefix, String postfix) Construct a new Printer.Printer
(ChannelInput in, String prefix, String postfix) Construct a new Printer with System.out as its PrintStream. -
Method Summary
-
Field Details
-
in
The channel from which to read -
printStream
The stream to which to write -
prefix
The string to write in front of each object -
postfix
The string to write after each object
-
-
Constructor Details
-
Printer
Construct a new Printer with System.out as its PrintStream and empty prefix and postfix strings.- Parameters:
in
- the channel from which to read
-
Printer
Construct a new Printer with System.out as its PrintStream.- Parameters:
in
- the channel from which to readprefix
- the string to write in front of each objectpostfix
- the string to write after each object
-
Printer
Construct a new Printer with empty prefix and postfix strings.- Parameters:
in
- the channel from which to readprintStream
- the stream to which to write
-
Printer
Construct a new Printer.- Parameters:
in
- he channel from which to readprintStream
- the stream to which to writeprefix
- the string to write in front of each objectpostfix
- the string to write after each object
-
-
Method Details