edu.ucdavis.rj.Ops
Class Co

java.lang.Object
  extended by edu.ucdavis.rj.Ops.Co

public class Co
extends java.lang.Object

//////////////////////////////////////////////////// An Co services on invocation from a specified group of CoOps. It consists of one or more possibly quantified arms; each arm specifies an operation or quantified group of operations and corresponding code to service the invocation. An Co also allows an elseArm, which is executed if no invocation is selected for servicing.


Field Summary
(package private)  java.util.ArrayList<CoArm> arms
           
 
Constructor Summary
Co(CoArm firstArm, CoArm... restArms)
          Create a new instance of an Co.
 
Method Summary
private  void createCo(CoArm firstArm, CoArm... restArms)
          Common code called from constructors to create a new instance of an Co.
 BaseArmCode.Control go()
          ///////////////////////// do all invocations and PPC Service one invocation as specified by this Co's arms by executing the codeBlock in the associated arm.
private  void oneCoArm(CoArm a, int armCount)
          Handle one abstract arm for this Co.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arms

java.util.ArrayList<CoArm> arms
Constructor Detail

Co

public Co(CoArm firstArm,
          CoArm... restArms)
Create a new instance of an Co. This is the general case (with an elseArm).

Parameters:
firstArm - The first arm.
restArms - Any other arms.
Method Detail

createCo

private void createCo(CoArm firstArm,
                      CoArm... restArms)
Common code called from constructors to create a new instance of an Co.

Parameters:
firstArm - The first arm.
restArms - Any other arms.

oneCoArm

private void oneCoArm(CoArm a,
                      int armCount)
Handle one abstract arm for this Co.

Parameters:
a - The arm.
armCount - The arm's number (0-based).

go

public BaseArmCode.Control go()
///////////////////////// do all invocations and PPC Service one invocation as specified by this Co's arms by executing the codeBlock in the associated arm. If no invocation selected, delay the executing process until such an invocation arrives, unless this Co has an elseArm, in which case execute the codeBlock in the elseArm.

Returns:
Value set within codeBlock indicating control flow to take.