All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jcsp.util.buildingblocks.Pairs

java.lang.Object
   |
   +----jcsp.util.buildingblocks.Pairs

public class Pairs
extends Object
implements CSProcess

Process Diagram

External View

         _______  
     in |       | out
    -->-| Pairs |-->---
        |_______|
 

Internal View

         _________________________________________
        |  _______                  _______       |
     in | |       |                |       |      | out
    -->---| Delta |------->--------| Plus  |--------->--- 
        | |_______|                |_______|      |
        |     |                       |           |
        |     |      ___________      |           |
        |     |     |           |     |           |
        |     +-->--|   Tail    |-->--+           |
        |           |___________|                 |
        |                                   Pairs |
        |_________________________________________|
 

Description

The Pairs class is a process which adds together the value of a Number sent down the in Channel and adds it together with the previous Number sent down the in Channel and outputs it down the out Channel. This continues forever.

Channel Protocols

Input Channels
in java.lang.Number The Channel can accept data from any subclass of Number.All values will be converted to ints.
Output Channels
out java.lang.Integer The output will always be of type Integer.

Author:
P.D.Austin

Constructor Index

 o Pairs(ChannelInput, ChannelOutput)
Construct a new Pairs process with the input Channel in and the output Channel out.

Method Index

 o run()
The main body of this process.

Constructors

 o Pairs
 public Pairs(ChannelInput in,
              ChannelOutput out)
Construct a new Pairs process with the input Channel in and the output Channel out.

Parameters:
in - The input Channel
out - The output Channel

Methods

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


All Packages  Class Hierarchy  This Package  Previous  Next  Index