public class PrinterInt extends java.lang.Object implements CSProcess
For convenience, PrinterInt may be configured with prefix and postfix strings with which to decorate its output.
Input Channels | ||
---|---|---|
in | int | All channels in this package carry integers. |
MergeInt
.Parallel
Modifier and Type | Field and Description |
---|---|
private ChannelInputInt |
in
The channel from which to read
|
private java.lang.String |
postfix
The string to write after each integer
|
private java.lang.String |
prefix
The string to write in front of each integer
|
private java.io.PrintStream |
printStream
The stream to which to write
|
Constructor and Description |
---|
PrinterInt(ChannelInputInt in)
Construct a new PrinterInt with System.out as
its PrintStream and empty prefix and postfix strings.
|
PrinterInt(ChannelInputInt in,
java.io.PrintStream printStream)
Construct a new PrinterInt with empty prefix and postfix strings.
|
PrinterInt(ChannelInputInt in,
java.io.PrintStream printStream,
java.lang.String prefix,
java.lang.String postfix)
Construct a new PrinterInt.
|
PrinterInt(ChannelInputInt in,
java.lang.String prefix,
java.lang.String postfix)
Construct a new PrinterInt with System.out as
its PrintStream.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
The main body of this process.
|
private ChannelInputInt in
private java.io.PrintStream printStream
private java.lang.String prefix
private java.lang.String postfix
public PrinterInt(ChannelInputInt in)
in
- the channel from which to readpublic PrinterInt(ChannelInputInt in, java.lang.String prefix, java.lang.String postfix)
in
- the channel from which to readprefix
- the string to write in front of each integerpostfix
- the string to write after each integerpublic PrinterInt(ChannelInputInt in, java.io.PrintStream printStream)
in
- the channel from which to readprintStream
- the stream to which to writepublic PrinterInt(ChannelInputInt in, java.io.PrintStream printStream, java.lang.String prefix, java.lang.String postfix)
in
- he channel from which to readprintStream
- the stream to which to writeprefix
- the string to write in front of each integerpostfix
- the string to write after each integer