ilog.rules.teamserver.model.states

Class CompoundTransitionCondition<State extends java.lang.Enum<State>>

    • Field Detail

      • negated

        protected boolean negated
        Indicates whether the whole compound condition is negated.
      • disjunction

        protected boolean disjunction
        Indicates whether the whole compound condition is a disjunction (or else a conjunction).
      • subconditions

        protected java.util.List<TransitionCondition<State extends java.lang.Enum<State>>> subconditions
        Stores the disjuncts or conjuncts.
    • Constructor Detail

      • CompoundTransitionCondition

        public CompoundTransitionCondition()

        Constructs a transition condition that is always true.

      • CompoundTransitionCondition

        public CompoundTransitionCondition(boolean neutral,
                                   TransitionCondition<State>... subconditions)

        Constructs a compound transition condition. If no sub-conditions are provided, the condition has always the Boolean value provided as first argument. If sub-conditions are provided, the condition is a conjunction (and) of the sub-conditions if the first argument is true; it is a disjunction (or) of the sub-conditions if the first argument is false.

        Parameters:
        neutral - If true, the condition is a conjunction (and) of the sub-conditions; if false, it is a disjunction (or).
        subconditions - Zero or more transition conditions. If none is provided, the condition has the constant value given by neutral.
      • CompoundTransitionCondition

        public CompoundTransitionCondition(boolean neutral,
                                   java.util.List<TransitionCondition<State>> subconditions)

        Constructs a compound transition condition. The condition is a conjunction (and) of the sub-conditions if the first argument is true; it is a disjunction (or) of the sub-conditions if the first argument is false.

        Parameters:
        neutral - If true, the condition is a conjunction (and) of the sub-conditions; if false, it is a disjunction (or).
        subconditions - A list of transition conditions.
    • Method Detail

      • check

        public boolean check(State s1,
                    State s2)
        Description copied from class: TransitionCondition

        Indicates whether the condition for the provided transition is satisfied.

        Specified by:
        check in class TransitionCondition<State extends java.lang.Enum<State>>
        Parameters:
        s1 - The start state of the transition, or null for transitions to s2 as an initial state.
        s2 - Then end state of the transition. Cannot be null.
        Returns:
        true if this condition allows a transition from s1 to s2.
      • impossibleTransitionCause

        public TransitionCondition<State> impossibleTransitionCause(State s1,
                                                           State s2)
        Description copied from class: TransitionCondition

        Returns the part of this condition that causes the provided transition to be impossible.

        Note: This method assumes that the provided transition is indeed not allowed by this condition. It does not test it. Unspecified result is returned if this method is called on a transition that is allowed by this condition.

        Specified by:
        impossibleTransitionCause in class TransitionCondition<State extends java.lang.Enum<State>>
        Parameters:
        s1 - The start state of the transition, or null when checking whether s2 is an allowed initial state.
        s2 - Then end state of the transition. Cannot be null.
        Returns:
        an instance of TransitionCondition that is not satisfied, which causes the provided transition to be impossible.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringNeedsParentheses

        protected boolean toStringNeedsParentheses()
        Description copied from class: TransitionCondition

        Indicates whether the string representation of this condition, if inserted in the string representation of a larger formula, should be enclosed in parentheses to respect operator precedence.

        Overrides:
        toStringNeedsParentheses in class TransitionCondition<State extends java.lang.Enum<State>>
        Returns:
        true if this condition is a combination of several other conditions.

© Copyright IBM Corp. 1987, 2017