Class ChoiceStringParameter

    • Field Detail

      • choices

        public StringParameter choices
        A comma-separated list of choices.
    • Constructor Detail

      • ChoiceStringParameter

        public ChoiceStringParameter​(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.
        enumClass - The enum class that contains the choices.
        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

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        React to a change in an attribute. This method is called by a contained attribute when its value changes. This overrides the base class to check whether the attribute is choices, and if so, it removes all previously specified choices and adds the ones given in choices.
        Overrides:
        attributeChanged in class Variable
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the change is not acceptable to this container.