Interface IEvlContext

All Superinterfaces:
IEolContext, IErlContext
All Known Subinterfaces:
IEvlContextParallel
All Known Implementing Classes:
EvlContext, EvlContextParallel

public interface IEvlContext extends IErlContext
  • Field Details

  • Method Details

    • getModule

      IEvlModule getModule()
      Casts the IModule to IEvlModule
      Specified by:
      getModule in interface IEolContext
      Specified by:
      getModule in interface IErlContext
      Since:
      1.6
      See Also:
    • getUnsatisfiedConstraints

      Collection<UnsatisfiedConstraint> getUnsatisfiedConstraints()
      This collection is written to internally by the engine during execution. Although IEvlModule.execute() mandates the results to be a Set, for performance optimisation reasons this method is permitted to return any collection, so long as once execution is complete, the results contain no duplicates. This collection should therefore only be used to add elements, and is expected not to be queried during execution.
      Returns:
      A mutable collection of unsatisfied Constraint-element pairs.
    • uniqueUnsatisfiedConstraints

      default Set<UnsatisfiedConstraint> uniqueUnsatisfiedConstraints()
      This method is called internally once all constraints have been processed to convert the underlying collection in getUnsatisfiedConstraints() to a unique one.
      Returns:
      The final, filtered set of UnsatisfiedConstraints suitable for post-processing.
      Since:
      1.6
    • getConstraintTrace

      ConstraintTrace getConstraintTrace()
      Used internally to determine evaluated constraints.
      Returns:
      The checked Constraint-element pairs, or null if the trace is disabled.
    • isOptimizeConstraintTrace

      boolean isOptimizeConstraintTrace()
      Return true if the constraint results cache is optimized. When optimized, constraint results will only be cached during satisfies operation executions, that is, results will only be cached if required. If false, constraint results will always be cached.

      The default value is false;

      Returns:
      The value of the flag.
      Since:
      1.6
    • setOptimizeConstraintTrace

      void setOptimizeConstraintTrace(boolean optimized)
      Set the flag for using optimized contraint result caching.
      Parameters:
      use - Set to true to use optimzied contraint caching.
      Since:
      1.6
      See Also:
    • isShortCircuiting

      boolean isShortCircuiting()
      Option allowing validation to terminate early when any invariant is unsatisfied.
      Returns:
      Whether validation will stop once an UnsatisfiedConstraint is found.
      Since:
      1.6
    • setShortCircuit

      void setShortCircuit(boolean shortCircuit)
      Sets whether short-circuited validation is enabled.
      Parameters:
      shortCircuit - The new value for the flag.
      Since:
      1.6
    • shouldShortCircuit

      default boolean shouldShortCircuit(Constraint constraint) throws EolRuntimeException
      Checks whether the condition for short-circuiting is met, either by previous invocation returning true or if there are unsatisfied constraints and the isShortCircuiting() flag is enabled, or if the specified module element has been annotated with a termination criteria and an unsatisfied constraint containing the type is already present.
      Parameters:
      Constraint - The rule with the termination annotation.
      Returns:
      Whether termination should be suspended.
      Throws:
      EolRuntimeException
      IllegalArgumentException - If the rule parameter is not an appropriate type.
      Since:
      1.6
    • hasFixes

      default boolean hasFixes()
      Returns:
      Since:
      1.6
    • sortUnsatisfiedConstraints

      default Map<Constraint,Set<Object>> sortUnsatisfiedConstraints()
      Returns:
      A mapping from a Constraint to all of its unsatisfied instances.
      Since:
      1.6
    • getUnsatisfiedConstraintsBySize

      default Map<Constraint,Integer> getUnsatisfiedConstraintsBySize()
      Returns:
      A sorted entry of Constraints with the number of unsatisfied instances, in descending order.
      Since:
      1.6
    • getConstraintsDependedOn

      default Set<Constraint> getConstraintsDependedOn()
      Returns:
      Since:
      1.6