CSP for Java
(JCSP) 1.1-rc4

org.jcsp.plugNplay.ints
Class RegularInt

java.lang.Object
  extended by org.jcsp.plugNplay.ints.RegularInt
All Implemented Interfaces:
CSProcess

public class RegularInt
extends Object
implements CSProcess

This process generates a constant stream of Integers at a regular rate.

Process Diagram

    ________________
   |                | out
   | RegularInt (n) |-->--
   |________________|
 

Description

This process generates a constant stream of Integers at a regular rate – at least, it does its best! If the consumption of data is less than the set rate, that rate cannot be sustained. If the consumption failure is only temporary, the set rate will be restored when consumption resumes.

The interval (in msecs) defining the output flow rate is given by a constructor argument.

Channel Protocols

Output Channels
out int A constant value is sent down this channel at a regular rate.

Author:
P.H. Welch
See Also:
FixedDelayInt, RegulateInt

Constructor Summary
RegularInt(ChannelOutputInt out, int n, long interval)
          Construct the process.
 
Method Summary
 void run()
          The main body of this process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegularInt

public RegularInt(ChannelOutputInt out,
                  int n,
                  long interval)
Construct the process.

Parameters:
out - the output channel
n - the value to be generated
interval - the interval between outputs (in milliseconds)
Method Detail

run

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

Specified by:
run in interface CSProcess

CSP for Java
(JCSP) 1.1-rc4

Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.