State - A Java enumeration.public abstract class TransitionCondition<State extends java.lang.Enum<State>>
extends java.lang.Object
Defines a condition by which a transition between states is allowed. Concrete transition conditions are usually defined by subclassing
AbstractTransitionCondition.
AbstractTransitionCondition| Constructor and Description |
|---|
TransitionCondition() |
| Modifier and Type | Method and Description |
|---|---|
abstract TransitionCondition<State> |
and(TransitionCondition<State>... conjuncts)
Returns a condition that is logically equivalent to the conjunction of this condition and the provided ones.
|
abstract boolean |
check(State s1,
State s2)
Indicates whether the condition for the provided transition is satisfied.
|
abstract TransitionCondition<State> |
impossibleTransitionCause(State s1,
State s2)
Returns the part of this condition that causes the provided transition to be impossible.
|
abstract TransitionCondition<State> |
not()
Returns a condition that is logically equivalent to the negation of this condition.
|
abstract TransitionCondition<State> |
or(TransitionCondition<State>... disjuncts)
Returns a condition that is logically equivalent to the disjunction of this condition and the provided ones.
|
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.
|
public abstract boolean check(State s1, State s2)
Indicates whether the condition for the provided transition is satisfied.
java.lang.NullPointerException - if s2 is null.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 abstract TransitionCondition<State> impossibleTransitionCause(State s1, State s2)
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.
java.lang.NullPointerException - if s2 is null.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 abstract TransitionCondition<State> not()
Returns 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.
public abstract TransitionCondition<State> and(TransitionCondition<State>... conjuncts)
Returns 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.
conjuncts - Zero or more transition conditions.public abstract TransitionCondition<State> or(TransitionCondition<State>... disjuncts)
Returns 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.
disjuncts - Zero or more transition conditions.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.
true if this condition is a combination of several other conditions.© Copyright IBM Corp. 1987, 2017