Class LocalConfiguration

java.lang.Object
net.ssehub.easy.varModel.cstEvaluation.LocalConfiguration
All Implemented Interfaces:
net.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext, IConfiguration

public class LocalConfiguration extends Object implements IConfiguration, net.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext
Creates a local configuration instance.
Author:
Holger Eichelberger
  • Field Details

  • Constructor Details

    • LocalConfiguration

      public LocalConfiguration()
      Creates a local configuration instance.
  • Method Details

    • getDecision

      public IDecisionVariable getDecision(AbstractVariable declaration)
      Description copied from interface: IConfiguration
      Returns the specified IDecisionVariable.
      Specified by:
      getDecision in interface IConfiguration
      Parameters:
      declaration - The declaration for which the configuration entity should be returned.
      Returns:
      The IDecisionVariable for the given declaration
    • addDecision

      public IDecisionVariable addDecision(IDecisionVariable decision)
      Adds a (local) decision to this configuration.
      Parameters:
      decision - the related decision
      Returns:
      decision (builder pattern style)
    • getAllInstances

      public Value getAllInstances(IDatatype type)
      Description copied from interface: IConfiguration
      Returns all instances of type.
      Specified by:
      getAllInstances in interface IConfiguration
      Parameters:
      type - the type to return the instances for
      Returns:
      all instances of type in terms of a container value consisting of references (may be null if this is not possible, e.g., in case of Integer)
    • bind

      Value bind(IDatatype type, EvaluationContext context)
      Binds the given type to the first matching decision variable. Rationale: Static (all-quantized) variable access needs to be bound automatically. In that case, there is an implicitly created enclosing quantor (rewritten expression), and only one, i.e., the first one can be bound.
      Parameters:
      type - the type to bind to
      context - the evaluation context
      Returns:
      the bound value (may be null if there is none)
    • setValue

      public void setValue(net.ssehub.easy.basics.modelManagement.IVariable variable, net.ssehub.easy.basics.modelManagement.Version version) throws net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
      Specified by:
      setValue in interface net.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext
      Throws:
      net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
    • unsetValue

      public void unsetValue(net.ssehub.easy.basics.modelManagement.IVariable variable) throws net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
      Specified by:
      unsetValue in interface net.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext
      Throws:
      net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
    • startEvaluation

      public Object startEvaluation() throws net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
      Specified by:
      startEvaluation in interface net.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext
      Throws:
      net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
    • endEvaluation

      public void endEvaluation(Object processor) throws net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
      Specified by:
      endEvaluation in interface net.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext
      Throws:
      net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
    • rebind

      void rebind(CustomOperation actual, CustomOperation replacement)
      Rebinds the parameters from actual to replacement, e.g., for dynamic dispatch. As a prerequisite, actual and replacement must have the same number of parameters and compatible parameter types, i.e., replacement must have the same or more specific parameter types then actual.
      Parameters:
      actual - the operation for which the parameters shall be replace
      replacement - the operation replacing actual
    • toString

      public String toString()
      Overrides:
      toString in class Object