Class ChoiceParameter

    • Constructor Detail

      • ChoiceParameter

        public ChoiceParameter​(NamedObj container,
                               java.lang.String name,
                               java.lang.Class<?> enumClass)
                        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

      • getChosenValue

        public java.lang.Object getChosenValue()
        Get the choice as a member of the enum class. The string value of that member (returned with its toString() method) is equal to the string value contained by this parameter.
        Returns:
        The chosen member of the enum class.