Class DecisionVariable

    • Constructor Detail

      • DecisionVariable

        public DecisionVariable​(java.lang.String name,
                                IDatatype type,
                                java.lang.String defaultValue,
                                Project parent)
                         throws ModelException
        Creates a new decision variable.
        Parameters:
        name - the name of the variable
        type - the type of the variable
        defaultValue - the default value (may be null)
        parent - the parent of the variable, i.e. the project
        Throws:
        ModelException - in case that the given value does not match to type
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: IDecisionVariable
        Returns the name of the variable.
        Specified by:
        getName in interface IDecisionVariable
        Returns:
        the name of the variable
      • getType

        public java.lang.String getType()
        Description copied from interface: IDecisionVariable
        Returns the type of the variable.
        Specified by:
        getType in interface IDecisionVariable
        Returns:
        the type of the variable, possibly adjusted by the model after adding this variable if the model supports fault-tolerance
      • getBindingTime

        public java.lang.String getBindingTime()
        Description copied from interface: IDecisionVariable
        Returns the binding time of the variable.
        Specified by:
        getBindingTime in interface IDecisionVariable
        Returns:
        the binding time, may be null if none is defined
      • getDefaultValue

        public java.lang.String getDefaultValue()
        Description copied from interface: IDecisionVariable
        Returns the default value of the variable as specified as part of the variable declaration in the underlying IVML model. For obtaining the actual value in a configuration, please refer to IDecisionVariable.getValue().
        Specified by:
        getDefaultValue in interface IDecisionVariable
        Returns:
        the default value, may be null if none is defined, possibly adjusted by the model after adding this variable if the model supports fault-tolerance
      • hasValue

        public boolean hasValue()
        Description copied from interface: IDecisionVariable
        Returns whether there this variable has been configured with a value.
        Specified by:
        hasValue in interface IDecisionVariable
        Returns:
        true if variable has been configured, false else
      • hasFrozenValue

        public boolean hasFrozenValue()
        Description copied from interface: IDecisionVariable
        Returns whether the this variable has been configured and is frozen.
        Specified by:
        hasFrozenValue in interface IDecisionVariable
        Returns:
        true if the configured value is frozen, false else
      • setBindingTime

        public void setBindingTime​(Enum bindingTimes,
                                   EnumLiteral bindingTime)
                            throws ModelException
        Changes the binding time.
        Parameters:
        bindingTimes - the binding times enum
        bindingTime - the new binding time
        Throws:
        ModelException - in case that the value cannot be set
      • getBindingTimeAttribute

        Attribute getBindingTimeAttribute()
        Returns the binding time attribute if there is any.
        Returns:
        the binding times attribute
      • getInstance

        public DecisionVariableDeclaration getInstance()
        Returns the corresponding IVML model instance.
        Returns:
        the corresponding model instance