State - A Java enumeration.public class CompoundTransitionCondition<State extends java.lang.Enum<State>> extends TransitionCondition<State>
Defines a condition by which a transition between states is allowed. This class implements logical combinations of transition conditions.
Such combinations can be created either by explicitly instantiating this class, or with the TransitionCondition.not(),
TransitionCondition.and(ilog.rules.teamserver.model.states.TransitionCondition<State>...), and TransitionCondition.or(ilog.rules.teamserver.model.states.TransitionCondition<State>...) methods.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
disjunction
Indicates whether the whole compound condition is a disjunction (or else a conjunction).
|
protected boolean |
negated
Indicates whether the whole compound condition is negated.
|
protected java.util.List<TransitionCondition<State>> |
subconditions
Stores the disjuncts or conjuncts.
|
| Constructor and Description |
|---|
CompoundTransitionCondition()
Constructs a transition condition that is always true.
|
CompoundTransitionCondition(boolean neutral,
java.util.List<TransitionCondition<State>> subconditions)
Constructs a compound transition condition.
|
CompoundTransitionCondition(boolean neutral,
TransitionCondition<State>... subconditions)
Constructs a compound transition condition.
|
| Modifier and Type | Method and Description |
|---|---|
TransitionCondition<State> |
and(TransitionCondition<State>... conjuncts)
Returns a condition that is logically equivalent to the conjunction of this condition and the provided ones.
|
boolean |
check(State s1,
State s2)
Indicates whether the condition for the provided transition is satisfied.
|
TransitionCondition<State> |
impossibleTransitionCause(State s1,
State s2)
Returns the part of this condition that causes the provided transition to be impossible.
|
TransitionCondition<State> |
not()
Returns a condition that is logically equivalent to the negation of this condition.
|
TransitionCondition<State> |
or(TransitionCondition<State>... disjuncts)
Returns a condition that is logically equivalent to the disjunction of this condition and the provided ones.
|
java.lang.String |
toString() |
protected boolean |
toStringNeedsParentheses()
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.
|
protected boolean negated
protected boolean disjunction
protected java.util.List<TransitionCondition<State extends java.lang.Enum<State>>> subconditions
public CompoundTransitionCondition()
Constructs a transition condition that is always true.
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.
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.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.
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.public boolean check(State s1, State s2)
TransitionConditionIndicates whether the condition for the provided transition is satisfied.
check in class TransitionCondition<State extends java.lang.Enum<State>>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.true if this condition allows a transition from s1 to s2.public TransitionCondition<State> impossibleTransitionCause(State s1, State s2)
TransitionConditionReturns 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.
impossibleTransitionCause in class TransitionCondition<State extends java.lang.Enum<State>>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.TransitionCondition that is not satisfied, which causes the provided transition to be impossible.public TransitionCondition<State> not()
TransitionConditionReturns a condition that is logically equivalent to the negation of this condition. No assumption should be made on whether this
condition or a new instance of TransitionCondition is returned.
not in class TransitionCondition<State extends java.lang.Enum<State>>public TransitionCondition<State> and(TransitionCondition<State>... conjuncts)
TransitionConditionReturns a condition that is logically equivalent to the conjunction of this condition and the provided ones.
No assumption should be made on whether this condition or a new instance of TransitionCondition is returned.
and in class TransitionCondition<State extends java.lang.Enum<State>>conjuncts - Zero or more transition conditions.public TransitionCondition<State> or(TransitionCondition<State>... disjuncts)
TransitionConditionReturns a condition that is logically equivalent to the disjunction of this condition and the provided ones.
No assumption should be made on whether this condition or a new instance of TransitionCondition is returned.
or in class TransitionCondition<State extends java.lang.Enum<State>>disjuncts - Zero or more transition conditions.public java.lang.String toString()
toString in class java.lang.Objectprotected boolean toStringNeedsParentheses()
TransitionConditionIndicates 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.
toStringNeedsParentheses in class TransitionCondition<State extends java.lang.Enum<State>>true if this condition is a combination of several other conditions.© Copyright IBM Corp. 1987, 2017