Package jetbrains.mps.smodel.runtime
Interface ConstraintFunction<Context,Result>
- 
- Type Parameters:
 Context- constraint function context type.Result- resulting constraint type.
public interface ConstraintFunction<Context,Result>Presents a constraint function. Constraint function supplies aConstraintFunctionin which constraint function are applied. Resulting constraint contains a "sequence" of objects that are applicable/valid in this context. In case, when result hasbooleantype, it means that supplied context is valid if function returns true. If constraint function returnsnull, it means that this constraint function doesn't provide any restrictions for these context. Basically, it means that any "object" is valid in this context. INHERITANCE NOTES: If constraint isn't defined externally, it should be calculated as composition of constraints defined in super concepts. For boolean-returning constraints it means that constraint composition returns true only if all super-concept constraints returns true. For scope-returning constraints it means that constraint composition returns a scope that contains nodes which are contained in all scopes provided via super-concept constraints. For other kinds it depends on implementation. Example: Assuming, there is concepts A, B, C, D: A extends B, C; B extends D; C extends D. There is no externally-defined 'can be child' constraint function (from now, CF) in concept A. Let predict calculated constraint function for cases: 1) CF defined only in B => CF for A returns same as CF for B 2) CF defined only in D => CF for A returns same as CF for D 3) CF defined in B and C => CF for A returns true only if CF for B & C returns true 4) CF defined in D and redefined in B => CF for A returns true only if CF for B & D returns true (but not only CF for B)- Since:
 - 3.5
 - See Also:
 ConstraintFunctions
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Resultinvoke(Context context, CheckingNodeContext checkingNodeContext) 
 -