Class StateMatcher

    • Constructor Detail

      • StateMatcher

        public StateMatcher​(CompositeEntity container,
                            java.lang.String name)
                     throws IllegalActionException,
                            NameDuplicationException
        Construct a state with the given name contained by the specified composite entity. The container argument must not be null, or a NullPointerException will be thrown. This state will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace. This constructor write-synchronizes on the workspace.
        Parameters:
        container - The container.
        name - The name of the state.
        Throws:
        IllegalActionException - If the state cannot be contained by the proposed container.
        NameDuplicationException - If the name coincides with that of an entity already in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the actor into the specified workspace. Set a type constraint that the output type is the same as the that of input.
        Overrides:
        clone in class State
        Parameters:
        workspace - The workspace for the new object.
        Returns:
        A new actor.
        Throws:
        java.lang.CloneNotSupportedException - If a derived class has has an attribute that cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • getCausalityInterface

        public CausalityInterface getCausalityInterface()
        Return a causality interface for this actor. In this base class, if there is a director, we delegate to the director to return a default causality interface. Otherwise, we return an instance of CausalityInterface with BooleanDependency.OTIMES_IDENTITY as its default. This declares the dependency between input ports and output ports of an actor to be true, the multiplicative identity. If this is called multiple times, the same object is returned each time unless the director has changed since the last call, in which case a new object is returned.
        Specified by:
        getCausalityInterface in interface Actor
        Returns:
        A representation of the dependencies between input ports and output ports.
      • getCriteriaAttribute

        public GTIngredientsAttribute getCriteriaAttribute()
        Return the attribute that stores all the criteria for this matcher.
        Specified by:
        getCriteriaAttribute in interface GTEntity
        Returns:
        The attribute that stores all the criteria.
      • getDefaultIconDescription

        public java.lang.String getDefaultIconDescription()
        Return null.
        Specified by:
        getDefaultIconDescription in interface GTEntity
        Returns:
        null.
      • getDirector

        public Director getDirector()
        Return null.
        Specified by:
        getDirector in interface Actor
        Returns:
        null.
      • getManager

        public Manager getManager()
        Return null.
        Specified by:
        getManager in interface Actor
        Returns:
        null.
      • getOperationsAttribute

        public GTIngredientsAttribute getOperationsAttribute()
        Return the attribute that stores all the operations for this matcher.
        Specified by:
        getOperationsAttribute in interface GTEntity
        Returns:
        The attribute that stores all the operations.
      • getPatternObjectAttribute

        public PatternObjectAttribute getPatternObjectAttribute()
        Return the attribute that stores the name of the corresponding entity in the pattern of the same TransformationRule, if this entity is in the replacement, or null otherwise.
        Specified by:
        getPatternObjectAttribute in interface GTEntity
        Returns:
        The attribute that stores the name of the corresponding entity.
        See Also:
        labelSet()
      • inputPortList

        public java.util.List<?> inputPortList()
        Return an empty list.
        Specified by:
        inputPortList in interface Actor
        Returns:
        An empty list.
      • isBackwardTypeInferenceEnabled

        public boolean isBackwardTypeInferenceEnabled()
        Return false because backward type inference is not implemented for this actor.
        Specified by:
        isBackwardTypeInferenceEnabled in interface TypedActor
        Returns:
        false
      • isFireFunctional

        public boolean isFireFunctional()
        Return true because prefire and fire do nothing.
        Specified by:
        isFireFunctional in interface Executable
        Returns:
        true.
      • isStrict

        public boolean isStrict()
        Return false.
        Specified by:
        isStrict in interface Executable
        Returns:
        false.
      • labelSet

        public java.util.Set<java.lang.String> labelSet()
        Return the set of names of ingredients contained in this entity that can be resolved.
        Specified by:
        labelSet in interface GTEntity
        Returns:
        The set of names.
      • match

        public boolean match​(NamedObj object)
        Return true if the given object is an instance of State (either the one in the deprecated FSM domain or the one in modal model since Ptolemy 8.0).
        Specified by:
        match in interface GTEntity
        Parameters:
        object - The object to be tested.
        Returns:
        true if the object is an instance of State.
      • outputPortList

        public java.util.List<?> outputPortList()
        Return an empty list.
        Specified by:
        outputPortList in interface Actor
        Returns:
        An empty list.
      • setContainer

        public void setContainer​(CompositeEntity container)
                          throws IllegalActionException,
                                 NameDuplicationException
        Specify the container, adding the entity to the list of entities in the container. If the container already contains an entity with the same name, then throw an exception and do not make any changes. Similarly, if the container is not in the same workspace as this entity, throw an exception. If this entity is a class element and the proposed container does not match the current container, then also throw an exception. If the entity is already contained by the container, do nothing. If this entity already has a container, remove it from that container first. Otherwise, remove it from the directory of the workspace, if it is present. If the argument is null, then unlink the ports of the entity from any relations and remove it from its container. It is not added to the workspace directory, so this could result in this entity being garbage collected. Derived classes may further constrain the container to subclasses of CompositeEntity by overriding the protected method _checkContainer(). This method validates all deeply contained instances of Settable, since they may no longer be valid in the new context. This method is write-synchronized to the workspace and increments its version number.
        Overrides:
        setContainer in class ComponentEntity
        Parameters:
        container - The proposed container.
        Throws:
        IllegalActionException - If the action would result in a recursive containment structure, or if this entity and container are not in the same workspace, or if the protected method _checkContainer() throws it, or if a contained Settable becomes invalid and the error handler throws it.
        NameDuplicationException - If the name of this entity collides with a name already in the container.
        See Also:
        ComponentEntity.getContainer()
      • stop

        public void stop()
        Do nothing.
        Specified by:
        stop in interface Executable
      • stopFire

        public void stopFire()
        Do nothing.
        Specified by:
        stopFire in interface Executable
      • terminate

        public void terminate()
        Do nothing.
        Specified by:
        terminate in interface Executable