All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jcsp.util.Printer

java.lang.Object
   |
   +----jcsp.util.Printer

public class Printer
extends Object
implements CSProcess

Process Diagram

      ___________
  in |           |
 -->-|  Printer  |
     |___________|
 

Description

The Printer process is an infinite loop which reads an Object from the in Channel and then writes it to the PrintStream out.

Example

See example in the jcsp.lang.Parallel class.

Author:
P.D.Austin
See Also:
Parallel

Constructor Index

 o Printer(ChannelInput)
Construct a new Printer with System.out as the PrintStream.
 o Printer(ChannelInput, PrintStream)
Construct a new Printer.
 o Printer(ChannelInput, PrintStream, String, String)
Construct a new Printer.
 o Printer(ChannelInput, String, String)
Construct a new Printer with System.out as the PrintStream.

Method Index

 o run()
The main body of this process.

Constructors

 o Printer
 public Printer(ChannelInput in)
Construct a new Printer with System.out as the PrintStream.

Parameters:
in - The Channel to read the Object from
 o Printer
 public Printer(ChannelInput in,
                String prefix,
                String postfix)
Construct a new Printer with System.out as the PrintStream.

Parameters:
in - The Channel to read the Object from
prefix - The String to write in front of each object
postfix - The String to write after each object
 o Printer
 public Printer(ChannelInput in,
                PrintStream out)
Construct a new Printer.

Parameters:
in - The Channel to read the Object from
out - The Stream to write the Object to
 o Printer
 public Printer(ChannelInput in,
                PrintStream out,
                String prefix,
                String postfix)
Construct a new Printer.

Parameters:
in - The Channel to read the Object from
out - The Stream to write the Object to
prefix - The String to write in front of each object
postfix - The String to write after each object

Methods

 o run
 public synchronized void run()
The main body of this process.


All Packages  Class Hierarchy  This Package  Previous  Next  Index