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 java.lang.Object implements IConfiguration, net.ssehub.easy.basics.modelManagement.IRestrictionEvaluationContext
Creates a local configuration instance.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<AbstractVariable,IDecisionVariable>map
-
Constructor Summary
Constructors Constructor Description LocalConfiguration()Creates a local configuration instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDecisionVariableaddDecision(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(java.lang.Object processor)ValuegetAllInstances(IDatatype type)Returns all instances oftype.IDecisionVariablegetDecision(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)java.lang.ObjectstartEvaluation()java.lang.StringtoString()voidunsetValue(net.ssehub.easy.basics.modelManagement.IVariable variable)
-
-
-
Field Detail
-
map
private java.util.Map<AbstractVariable,IDecisionVariable> map
-
-
Method Detail
-
getDecision
public IDecisionVariable getDecision(AbstractVariable declaration)
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
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: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
Value bind(IDatatype type, EvaluationContext context)
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 java.lang.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(java.lang.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
void rebind(CustomOperation actual, CustomOperation replacement)
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-