T - The type of the event on the transitionpublic abstract class Transition<T extends Event>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Action<T> |
m_action
The action associated to this transition.
|
protected Operator<T> |
m_guard
A Boolean expression
|
protected Configuration<T> |
m_target
The target of this transition
|
| Constructor and Description |
|---|
Transition()
Creates a new empty transition
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
afterGuard(T event,
Statechart<T> statechart)
Checks whether a transition fires, after the guard on that transition
has been evaluated.
|
abstract Transition<T> |
clone() |
void |
executeAction(T event,
Statechart<T> statechart)
Executes the action associated to this transition, if one is defined
|
Action<T> |
getAction()
Gets the action associated to this transition
|
Operator<T> |
getGuard()
Gets the guard associated to this transition
|
Configuration<T> |
getTarget()
Gets the target of this transition
|
protected boolean |
hasSameParameters(Transition<T> t)
Checks that this transition has the same parameters (guard, action,
target) as another one
|
boolean |
matches(T event,
Statechart<T> statechart)
Determines if this transition applies (i.e.
|
Transition<T> |
setAction(Action<T> action)
Associates an action to this transition
|
Transition<T> |
setGuard(Operator<T> guard)
Associates a guard to this transition
|
protected Configuration<T extends Event> m_target
protected Action<T extends Event> m_action
public Transition()
statechart - The statechart this transition belongs topublic final boolean matches(T event, Statechart<T> statechart)
event - The eventstatechart - The statechart this transition belongs totrue if the transition fires, false otherwiseprotected abstract boolean afterGuard(T event, Statechart<T> statechart)
true.event - The eventstatechart - The statechart this transition belongs totrue if the transition fires, false otherwisepublic abstract Transition<T> clone()
clone in class java.lang.Objectpublic Configuration<T> getTarget()
protected boolean hasSameParameters(Transition<T> t)
t - The other transitiontrue if the transition has the same parameters,
false otherwisepublic Transition<T> setAction(Action<T> action)
action - An action. May be null; in such a case, deletes
any action already associated to the transition.public Transition<T> setGuard(Operator<T> guard)
action - An guard. May be null; in such a case, deletes
any guard already associated to the transition.public void executeAction(T event, Statechart<T> statechart) throws ActionException
event - The event that fired this transitionstatechart - The statechart this transition belongs toActionExceptionpublic Operator<T> getGuard()
null if no guard is definedCopyright © Sylvain HallĂ©. All Rights Reserved.