org.eclipse.viatra.query.runtime.localsearch.matcher.integration

## Interface IAdornmentProvider

- All Known Implementing Classes:
    AllValidAdornments, LazyPlanningAdornments

      public interface IAdornmentProvider

  An adornment provider is used to define the adornments the pattern matcher should prepare for.

  A default implementation is available in `AllValidAdornments` that describes all adornments fulfilling the parameter direction declarations; another default option (with better performance but restricted applicability) is `LazyPlanningAdornments`.
  Users may implement this interface to limit the number of prepared plans based on some runtime information:

       class SomeAdornments{

           public Iterable<Set<PParameter>> getAdornments(PQuery query){
               if (SomeGeneratedQuerySpecification.instance().getInternalQueryRepresentation().equals(query)){
                   return Collections.singleton(Sets.filter(Sets.newHashSet(query.getParameters()), new Predicate() {

                        @Override
                        public boolean apply(PParameter input) {
                            // Decide whether this particular parameter will be bound
                            return false;
                        }
                    }));
               }
               // Returning an empty iterable is safe for unknown queries
               return Collections.emptySet();
           }

       }

  Since:
    1.5

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Iterable<java.util.Set<PParameter>>` | `getAdornments(PQuery query)` The bound parameter sets
    `static QueryEvaluationHint` | `toHint(IAdornmentProvider adornmentProvider)`

- - ### Method Detail

    - #### getAdornments

          java.lang.Iterable<java.util.Set<PParameter>> getAdornments(PQuery query)

      The bound parameter sets

    - #### toHint

          static QueryEvaluationHint toHint(IAdornmentProvider adornmentProvider)

      Returns:
        a simple hint that only overrides the adornment provider
      Since:
        2.1