Class CompositeCondition

    • Constructor Detail

      • CompositeCondition

        public CompositeCondition()
    • Method Detail

      • preMatchHook

        public void preMatchHook​(RuleEvaluation e)
        Description copied from class: Condition
        Called when match is called, before anything else. Always call super.preMatchHook when overriding.
        Overrides:
        preMatchHook in class Condition
      • postMatchHook

        public void postMatchHook​(RuleEvaluation e)
        Description copied from class: Condition
        Called just before match returns, on any return condition including exceptions. Always call super.postMatchHook when overriding
        Overrides:
        postMatchHook in class Condition
      • hasOpenChoicepoint

        protected boolean hasOpenChoicepoint​(RuleEvaluation evaluation)
        Description copied from class: Condition
        Returns whether there is an open choice in this or any of its subconditions. Returns false by default, must be overriden by conditions which may generate choices open accross multiple calls to matches, or contain such conditions.
        Overrides:
        hasOpenChoicepoint in class Condition
      • addCondition

        public void addCondition​(Condition condition)
      • setCondition

        public void setCondition​(int index,
                                 Condition condition)
        Sets the condition at the given index
      • conditionSize

        public int conditionSize()
        Returns the number of subconditions
      • getCondition

        public Condition getCondition​(int i)
        Returns the condition at the given index
        Parameters:
        i - the 0-base index
        Returns:
        the condition at this index
        Throws:
        java.lang.IndexOutOfBoundsException - if there is no condition at this index
      • removeCondition

        public Condition removeCondition​(int i)
        Returns the condition at the given index
        Parameters:
        i - the 0-base index
        Returns:
        the removed condition
        Throws:
        java.lang.IndexOutOfBoundsException - if there is no condition at this index
      • conditionIterator

        public java.util.Iterator<Condition> conditionIterator()
        Returns an iterator of the immediate children of this condition
      • makeReferences

        public void makeReferences​(RuleBase rules)
        Description copied from class: Condition
        Override if references needs to be set in this condition of its children
        Overrides:
        makeReferences in class Condition
      • useParentheses

        protected boolean useParentheses()
        Whether this should be output with parentheses, default is parent!=null
      • toInnerString

        protected java.lang.String toInnerString​(java.lang.String conditionSeparator)
      • conditionsToString

        protected final java.lang.String conditionsToString​(java.lang.String conditionSeparator)
      • allSubConditionsMatches

        protected final boolean allSubConditionsMatches​(RuleEvaluation e)
        Returns whether all the conditions of this matches the current evaluation state