Class ModelParameter

    • Constructor Detail

      • ModelParameter

        public ModelParameter​(NamedObj container,
                              java.lang.String name)
                       throws IllegalActionException,
                              NameDuplicationException
        Construct a parameter with the given name contained by the specified entity. The container argument must not be null, or a NullPointerException will be thrown. This parameter 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. The object is not added to the list of objects in the workspace unless the container is null. Increment the version of the workspace.
        Parameters:
        container - The container.
        name - The name of the parameter.
        Throws:
        IllegalActionException - If the parameter is not of an acceptable class for the container.
        NameDuplicationException - If the name coincides with a parameter already in the container.
    • Method Detail

      • addInitializable

        public void addInitializable​(Initializable initializable)
        Add the specified object to the list of objects whose preinitialize(), initialize(), and wrapup() methods should be invoked upon invocation of the corresponding methods of this object.
        Specified by:
        addInitializable in interface Initializable
        Parameters:
        initializable - The object whose methods should be invoked.
        See Also:
        removeInitializable(Initializable)
      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the parameter. This creates a new variable containing the same token (if the value was set with setToken()) or the same (unevaluated) expression, if the expression was set with setExpression(). The list of variables added to the scope is not cloned; i.e., the clone has an empty scope. The clone has the same static type constraints (those given by setTypeEquals() and setTypeAtMost()), but none of the dynamic type constraints (those relative to other variables).
        Overrides:
        clone in class Parameter
        Parameters:
        workspace - The workspace in which to place the cloned variable.
        Returns:
        The cloned variable.
        Throws:
        java.lang.CloneNotSupportedException - Not thrown in this base class.
        See Also:
        Object.clone()
      • exportMoML

        public void exportMoML​(java.io.Writer output,
                               int depth,
                               java.lang.String name)
                        throws java.io.IOException
        Write a MoML description of this parameter, unless this parameter is not persistent.
        Specified by:
        exportMoML in interface MoMLExportable
        Overrides:
        exportMoML in class Parameter
        Parameters:
        output - The output stream to write to.
        depth - The depth in the hierarchy, to determine indenting.
        name - The name to use instead of the current name.
        Throws:
        java.io.IOException - If an I/O error occurs.
        See Also:
        NamedObj.isPersistent()
      • modelChanged

        public void modelChanged()
        React to change of the model in this parameter.
      • removeInitializable

        public void removeInitializable​(Initializable initializable)
        Remove the specified object from the list of objects whose preinitialize(), initialize(), and wrapup() methods should be invoked upon invocation of the corresponding methods of this object. If the specified object is not on the list, do nothing.
        Specified by:
        removeInitializable in interface Initializable
        Parameters:
        initializable - The object whose methods should no longer be invoked.
        See Also:
        addInitializable(Initializable)
      • setModel

        public void setModel​(CompositeEntity model)
        Set the model in this parameter.
        Parameters:
        model - The new model.
        See Also:
        getModel()