Class Case

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class Case
    extends MultiCompositeActor
    An actor that executes one of several refinements depending on the value provided by the control port-parameter. To use this, drag the Case icon onto the canvas, right click and select Open Actor. To add a refinement, go to the Case menu in the menu bar and select Add Case, then populate populate the refinement with computations. Each refinement is a composite that is required to have its own director. The name of the refinement is value that the control must have to execute this refinement. This actor always provides one case called "default". This is the refinement that is executed if no other refinement matches the control input. All refinements have the same ports, and adding ports to any one refinement or to the case actor itself results in identical ports being added to all refinements.
    Since:
    Ptolemy II 5.2
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (reviewmoderator)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • control

        public PortParameter control
        The input port-parameter on which the control token is provided. This can have any type, and is initialized with a default value of true.
      • _current

        protected Refinement _current
        The current refinement.
      • _default

        protected Refinement _default
        The default refinement.
    • Constructor Detail

      • Case

        public Case​(Workspace workspace)
             throws IllegalActionException,
                    NameDuplicationException
        Construct a Case in the specified workspace with no container and an empty string as a name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace.
        Parameters:
        workspace - The workspace that will list the actor.
        Throws:
        IllegalActionException - If the name has a period in it, or the director is not compatible with the specified container.
        NameDuplicationException - If the container already contains an entity with the specified name.