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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDecision(IDecisionVariable decision) Adds a (local) decision to this configuration.(package private) Valuebind(IDatatype type, EvaluationContext context) Binds the giventypeto the first matching decision variable.voidendEvaluation(Object processor) getAllInstances(IDatatype type) Returns all instances oftype.getDecision(AbstractVariable declaration) Returns the specifiedIDecisionVariable.(package private) voidrebind(CustomOperation actual, CustomOperation replacement) Rebinds the parameters fromactualtoreplacement, e.g., for dynamic dispatch.voidsetValue(net.ssehub.easy.basics.modelManagement.IVariable variable, net.ssehub.easy.basics.modelManagement.Version version) toString()voidunsetValue(net.ssehub.easy.basics.modelManagement.IVariable variable)
-
Field Details
-
map
-
-
Constructor Details
-
LocalConfiguration
public LocalConfiguration()Creates a local configuration instance.
-
-
Method Details
-
getDecision
Description copied from interface:IConfigurationReturns the specifiedIDecisionVariable.- Specified by:
getDecisionin interfaceIConfiguration- Parameters:
declaration- The declaration for which the configuration entity should be returned.- Returns:
- The
IDecisionVariablefor the given declaration
-
addDecision
Adds a (local) decision to this configuration.- Parameters:
decision- the related decision- Returns:
decision(builder pattern style)
-
getAllInstances
Description copied from interface:IConfigurationReturns all instances oftype.- Specified by:
getAllInstancesin interfaceIConfiguration- 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
Binds the giventypeto 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 tocontext- 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:
setValuein interfacenet.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:
unsetValuein interfacenet.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:
startEvaluationin interfacenet.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:
endEvaluationin interfacenet.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext- Throws:
net.ssehub.easy.basics.modelManagement.RestrictionEvaluationException
-
rebind
Rebinds the parameters fromactualtoreplacement, e.g., for dynamic dispatch. As a prerequisite,actualandreplacementmust have the same number of parameters and compatible parameter types, i.e.,replacementmust have the same or more specific parameter types thenactual.- Parameters:
actual- the operation for which the parameters shall be replacereplacement- the operation replacingactual
-
toString
-