Class ConstantAccessor


  • public class ConstantAccessor
    extends EvaluationAccessor
    Implements an accessor for constant values. [public for testing]
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ConstantAccessor

        private ConstantAccessor()
        Creates an instance. Private due to pooling.
    • Method Detail

      • bind

        public ConstantAccessor bind​(Value value,
                                     boolean isConstant,
                                     EvaluationContext context)
        Binds the accessor to the given value and context.
        Parameters:
        value - the actual value
        isConstant - whether value is still (potentially) linked by reference to a decision variable (false), else whether it is actually a truely constant
        context - the evaluation context
        Returns:
        this (builder pattern)
      • setValue

        public boolean setValue​(Value value,
                                boolean asAssignment)
        Description copied from class: EvaluationAccessor
        Defines a new value for the accessed element. In case of failures, add appropriate messages to the context.
        Specified by:
        setValue in class EvaluationAccessor
        Parameters:
        value - the new value
        asAssignment - does this happen through an IVML assignment operation
        Returns:
        true if successful, false else
      • isAssignable

        public boolean isAssignable()
        Description copied from class: EvaluationAccessor
        Returns whether values can be assigned to this evaluator.
        Specified by:
        isAssignable in class EvaluationAccessor
        Returns:
        true if values can be assigned, false else
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isConstant

        public boolean isConstant()
        Description copied from class: EvaluationAccessor
        Returns whether this accessor represents a constant in the sense of the evaluation process, i.e., a value that is already evaluated to its very end and not linked to any decision variable.
        Overrides:
        isConstant in class EvaluationAccessor
        Returns:
        true for constant, false else