Class BatchTransformationStatements


  • public class BatchTransformationStatements
    extends java.lang.Object
    Utility class for simple rule usage
    • Method Detail

      • fireUntil

        public <Match extends IPatternMatch> void fireUntil​(BatchTransformationRule<Match,​?> rule,
                                                            java.util.function.Predicate<Match> breakCondition)
        Executes the selected rule with the selected filter as long as there are possible matches of its preconditions and the break condition is not fulfilled. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
        Since:
        2.0
      • fireUntil

        @SafeVarargs
        public final <Match extends IPatternMatch> void fireUntil​(BatchTransformationRule<Match,​?> rule,
                                                                  java.util.function.Predicate<Match> breakCondition,
                                                                  java.util.Map.Entry<java.lang.String,​?>... filterParameters)
        Executes the selected rule with the selected filter as long as there are possible matches of its precondition and the break condition is not fulfilled. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
        Since:
        2.0
      • fireUntil

        public <Match extends IPatternMatch> void fireUntil​(BatchTransformationRule<Match,​?> rule,
                                                            java.util.function.Predicate<Match> breakCondition,
                                                            EventFilter<? super Match> filter)
        Executes the selected rule with the selected filter as long as there are possible matches of its precondition and the break condition is not fulfilled. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
        Since:
        2.0
      • fireUntil

        public void fireUntil​(BatchTransformationRuleGroup rules,
                              java.util.function.Predicate<IPatternMatch> breakCondition)
        Executes the selected rules with the selected filter as long as there are possible matches of any of their preconditions and the break condition is not fulfilled. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
        Since:
        2.0
      • fireUntil

        public void fireUntil​(java.util.function.Predicate<IPatternMatch> breakCondition)
        Executes all rules of the transformation with the selected filter as long as there are possible matches of any of their preconditions and the break condition is not fulfilled. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
        Since:
        2.2
      • fireWhilePossible

        public <Match extends IPatternMatch> void fireWhilePossible​(BatchTransformationRule<Match,​?> rule)
        Executes the selected rule with the selected filter as long as there are possible matches of its precondition. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
      • fireWhilePossible

        public <Match extends IPatternMatch> void fireWhilePossible​(BatchTransformationRule<Match,​?> rule,
                                                                    EventFilter<? super Match> filter)
        Executes the selected rule with the selected filter as long as there are possible matches of its preconditions. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
      • fireWhilePossible

        public void fireWhilePossible​(BatchTransformationRuleGroup rules)
        Executes the selected rules with the default filter as long as there are possible matches of any of their preconditions. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
      • fireWhilePossible

        public void fireWhilePossible()
        Executes all rules of the transformation with the default as long as there are possible matches of any of their preconditions. The matches are executed one-by-one, in case of conflicts only one of the conflicting matches will be fired.
        Since:
        2.2
      • fireAllCurrent

        public <Match extends IPatternMatch> void fireAllCurrent​(BatchTransformationRule<Match,​?> rule)
        Executes the selected rule with the selected filter on its current match set of the precondition.
      • fireAllCurrent

        @SafeVarargs
        public final <Match extends IPatternMatch> void fireAllCurrent​(BatchTransformationRule<Match,​?> rule,
                                                                       java.util.Map.Entry<java.lang.String,​?>... parameterFilter)
        Executes the selected rule with the selected filter on its current match set of the precondition.
        Since:
        2.0
      • fireAllCurrent

        public <Match extends IPatternMatch> void fireAllCurrent​(BatchTransformationRule<Match,​?> rule,
                                                                 EventFilter<? super Match> filter)
        Executes the selected rule with the selected filter on its current match set of the precondition.
      • registerRule

        @Deprecated
        public <Match extends IPatternMatch> boolean registerRule​(RuleSpecification<Match> ruleSpecification)
        Deprecated.
        Added to the API as an error, should have been internal helper method.
      • registerRule

        @Deprecated
        public <Match extends IPatternMatch> boolean registerRule​(RuleSpecification<Match> ruleSpecification,
                                                                  EventFilter<? super Match> filter)
        Deprecated.
        This method was added to the API as an error, should not be available for transformation developers.
      • registerRules

        @Deprecated
        public void registerRules​(BatchTransformationRuleGroup rules)
        Deprecated.
        This method was added to the API as an error, should not be available for transformation developers.
      • countAllCurrent

        public <Match extends IPatternMatch> int countAllCurrent​(BatchTransformationRule<Match,​?> rule)
        Returns the number of current activations of the rule.
        Since:
        1.5
      • countAllCurrent

        @SafeVarargs
        public final <Match extends IPatternMatch> int countAllCurrent​(BatchTransformationRule<Match,​?> rule,
                                                                       java.util.Map.Entry<java.lang.String,​?>... parameterFilter)
        Returns the number of current activations of the rule.
        Since:
        2.0
      • hasCurrent

        @SafeVarargs
        public final <Match extends IPatternMatch> boolean hasCurrent​(BatchTransformationRule<Match,​?> rule,
                                                                      java.util.Map.Entry<java.lang.String,​?>... parameterFilter)
        Returns whether the given rule can be fired
        Since:
        2.2
      • hasCurrent

        public boolean hasCurrent​(BatchTransformationRuleGroup rules)
        Returns whether at least a single rule in the given group can be fired using its default filters.
        Since:
        2.2
      • hasCurrent

        public boolean hasCurrent()
        Returns whether at least a single rule of the transformation can be fired using its default filters.
        Since:
        2.2
      • disposeRule

        @Deprecated
        public <Match extends IPatternMatch> boolean disposeRule​(RuleSpecification<Match> ruleSpecification)
        Deprecated.
        This method was added to the API as an error, should not be available for transformation developers.
      • disposeRule

        @Deprecated
        public <Match extends IPatternMatch> boolean disposeRule​(RuleSpecification<Match> ruleSpecification,
                                                                 EventFilter<? super Match> filter)
        Deprecated.
        This method was added to the API as an error, should not be available for transformation developers.
      • disposeRules

        @Deprecated
        public void disposeRules​(BatchTransformationRuleGroup rules)
        Deprecated.
        This method was added to the API as an error, should not be available for transformation developers.
      • fireOne

        public <Match extends IPatternMatch> void fireOne​(BatchTransformationRule<Match,​?> rule)
        Selects and fires an activation of the selected rule with the default filter of the rule.

        Warning: the selection criteria undefined - it is neither random nor controllable

      • fireOne

        @SafeVarargs
        public final <Match extends IPatternMatch> void fireOne​(BatchTransformationRule<Match,​?> rule,
                                                                java.util.Map.Entry<java.lang.String,​?>... parameterFilter)
        Selects and fires an activation of the selected rule with a corresponding filter

        Warning: the selection criteria is undefined - it is neither random nor controllable

        Since:
        2.0
      • fireOne

        public <Match extends IPatternMatch> void fireOne​(BatchTransformationRule<Match,​?> rule,
                                                          EventFilter<? super Match> filter)
        Selects and fires an activation of the selected rule with a corresponding filter.

        Warning: the selection criteria is undefined - it is neither random nor controllable

      • fireAllCurrent

        public void fireAllCurrent​(BatchTransformationRuleGroup rules)
        Executes the selected rules with their default filter on its current match set of the precondition.
        Since:
        2.2
      • fireAllCurrent

        public void fireAllCurrent()
        Executes the selected rules with their default filter on its current match set of the precondition.
        Since:
        2.2