Class Transform

    • Field Detail

      • defer

        public Parameter defer
        Whether the transformation should be deferred with a change request.
      • matched

        public Parameter matched
        Whether the last pattern matching was successful (read-only).
      • _transformation

        protected TransformationRule _transformation
        The encapsulated transformation rule.
    • Constructor Detail

      • Transform

        public Transform​(CompositeEntity container,
                         java.lang.String name)
                  throws IllegalActionException,
                         NameDuplicationException
        Construct an event with the given name contained by the specified composite entity. The container argument must not be null, or a NullPointerException will be thrown. This event 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

      • addObject

        public void addObject​(NamedObj object)
        Invoked when the specified object is added to a container.
        Specified by:
        addObject in interface TransformationListener
        Parameters:
        object - The added object.
      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the event into the specified workspace. This calls the base class and then sets the attribute and port public members to refer to the attributes and ports of the new state.
        Overrides:
        clone in class Event
        Parameters:
        workspace - The workspace for the new event.
        Returns:
        A new event.
        Throws:
        java.lang.CloneNotSupportedException - If a derived class contains an attribute that cannot be cloned.
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • configure

        public void configure​(java.net.URL base,
                              java.lang.String source,
                              java.lang.String text)
                       throws java.lang.Exception
        Configure this event with a transformation rule (an instance of TransformationRule) stored in the moml.
        Specified by:
        configure in interface Configurable
        Overrides:
        configure in class State
        Parameters:
        base - The base relative to which references within the input are found, or null if this is not known, or there is none.
        source - The input source, which specifies a URL, or null if none.
        text - Configuration information given as text, or null if none.
        Throws:
        java.lang.Exception - If something goes wrong.
      • fire

        public Event.RefiringData fire​(Token arguments)
                                throws IllegalActionException
        Process this event and transform (or pattern-match) the model in the model parameter depending on the transformation model mode.
        Overrides:
        fire in class Event
        Parameters:
        arguments - The arguments used to process this event, which must be either an ArrayToken or a RecordToken.
        Returns:
        A refiring data structure that contains a non-negative double number if refire() should be called after that amount of model time, or null if refire() need not be called.
        Throws:
        IllegalActionException - If the model cannot be transformed, or if thrown by the superclass.
        See Also:
        TransformationMode
      • getConfigureSource

        public java.lang.String getConfigureSource()
        Return the input source that was specified the last time the configure method was called.
        Specified by:
        getConfigureSource in interface Configurable
        Overrides:
        getConfigureSource in class State
        Returns:
        The string representation of the input URL, or null if the no source has been used to configure this object, or null if no external source need be used to configure this object.
      • getConfigureText

        public java.lang.String getConfigureText()
        Return the text string that represents the current configuration of this object. Note that any configuration that was previously specified using the source attribute need not be represented here as well.
        Specified by:
        getConfigureText in interface Configurable
        Overrides:
        getConfigureText in class State
        Returns:
        A configuration string, or null if no configuration has been used to configure this object, or null if no configuration string need be used to configure this object.
      • _exportMoMLContents

        protected void _exportMoMLContents​(java.io.Writer output,
                                           int depth)
                                    throws java.io.IOException
        Write a MoML description of the contents of this object, which in this class are the attributes plus the ports. This method is called by exportMoML(). Each description is indented according to the specified depth and terminated with a newline character.
        Overrides:
        _exportMoMLContents in class State
        Parameters:
        output - The output to write to.
        depth - The depth in the hierarchy, to determine indenting.
        Throws:
        java.io.IOException - If an I/O error occurs.
        See Also:
        NamedObj.exportMoML(Writer, int)
      • _isActiveRefinement

        protected boolean _isActiveRefinement​(TypedActor refinement)
        Return whether the given refinement is active. The result is false unless the refinement is not the TransformationRule instance.
        Overrides:
        _isActiveRefinement in class Event
        Parameters:
        refinement - The refinement.
        Returns:
        Whether the refinement is active.