Class ParametersAttribute

    • Constructor Detail

      • ParametersAttribute

        public ParametersAttribute​(NamedObj container,
                                   java.lang.String name)
                            throws IllegalActionException,
                                   NameDuplicationException
        Construct a attribute for a list of typed parameters with the given name contained by the specified container. The container argument must not be null, or a NullPointerException will be thrown. This attribute 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 added to the directory of the workspace if the container is null.
        Parameters:
        container - The container.
        name - The name of this attribute.
        Throws:
        IllegalActionException - If the attribute is not of an acceptable class for the container, or if the name contains a period.
        NameDuplicationException - If the name coincides with an attribute already in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the attribute into the specified workspace. The new attribute is not added to the directory of that workspace (you must do this yourself if you want it there). The result is an attribute with no container.
        Overrides:
        clone in class Parameter
        Parameters:
        workspace - The workspace for the cloned object.
        Returns:
        The new Attribute.
        Throws:
        java.lang.CloneNotSupportedException - Not thrown in this base class
        See Also:
        Object.clone()
      • getParameterNames

        public java.util.List<java.lang.String> getParameterNames()
                                                           throws IllegalActionException
        Return a list of names (in the String type) of the parameters defined in this attribute.
        Returns:
        A list of names.
        Throws:
        IllegalActionException - If the list of parameters cannot be parsed.
        See Also:
        getParameterTypes()
      • _evaluate

        protected void _evaluate()
                          throws IllegalActionException
        Evaluate the current expression to a token. The expression of this parameter must be a parentheses enclosed string with comma-separated pairs of parameter names and types. Each name and type must be separated by a colon. Examples of an acceptable expressions are:
        (a)
        and
        (a:int, b:double)
        Overrides:
        _evaluate in class Variable
        Throws:
        IllegalActionException - If the expression cannot be parsed or cannot be evaluated, or if a dependency loop is found.