public abstract class AbstractState extends Object implements State
Abstract base class for State
definitions. Each state is owned
by exactly one owning Dialog
. While an application
is running, Dialog
(and the constituent State
s and
other configuration information) is immutable, so that it may be
shared by multiple simultaneous paths of execution.
Constructor and Description |
---|
AbstractState() |
Modifier and Type | Method and Description |
---|---|
void |
addTransition(Transition transition)
|
Transition |
findTransition(String outcome)
Return the
Transition for the specified logical outcome,
if any; otherwise, return null . |
Dialog |
getDialog()
|
String |
getName()
|
Iterator |
getTransitionOutcomes()
|
void |
removeTransition(Transition transition)
Remove the specified
Transition from the Transition s
owned by this State , if it is currently registered. |
void |
setDialog(Dialog dialog)
|
void |
setName(String name)
|
public Dialog getDialog()
public String getName()
public Iterator getTransitionOutcomes()
Return an Iterator
over the logical outcomes of
local Transition
s for this State
. If there are
no such Transition
s, an empty Iterator
is
returned.
getTransitionOutcomes
in interface State
Iterator
over the logical outcomes of local
Transition
s for this State
public Transition findTransition(String outcome)
Return the Transition
for the specified logical outcome,
if any; otherwise, return null
.
findTransition
in interface State
outcome
- Logical outcome for which to return a Transition
Transition
public void addTransition(Transition transition) throws IllegalArgumentException
Add the specified Transition
to the Transition
s owned
by this State
.
transition
- Transition
to be addedIllegalArgumentException
- if the specified Transition
cannot be added to this State
public void removeTransition(Transition transition)
Remove the specified Transition
from the Transition
s
owned by this State
, if it is currently registered. Otherwise,
do nothing.
transition
- Transition
to be removedpublic void setName(String name)
name
- New identifierCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.