|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.nexttext.behaviour.AbstractAction net.nexttext.behaviour.control.Chain
public class Chain
A series of Actions, each of which is executed when the previous one is complete.
The current action in the chain is remembered for each TextObject. When behave is called, that action is called. If that action returns complete or won't complete and returns an event, then the current action is moved to the next action, to be called next time.
If the current action is incremented, then ActionResult.event is returned, unless there is no next action, in which case ActionResult.complete is returned.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action |
---|
Action.ActionResult |
Constructor Summary | |
---|---|
Chain()
Create a new Chain with no actions. |
|
Chain(java.util.List<Action> actions)
Creates a new Chain with the given actions. |
Method Summary | |
---|---|
void |
add(Action action)
Add an action to the end of the Chain. |
Action.ActionResult |
behave(TextObject to)
Process the current action for the given TextObject. |
void |
complete(TextObject to)
The chain has ended for this TextObject, forget internal state. |
java.util.Map<java.lang.String,Property> |
getRequiredProperties()
The required properties are the union of all properties in the action chain. |
Methods inherited from class net.nexttext.behaviour.AbstractAction |
---|
behave, behave, getDisplayName, makeBehaviour, properties, setDisplayName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Chain(java.util.List<Action> actions)
actions
- a List containing Action objects.public Chain()
Method Detail |
---|
public void add(Action action)
public Action.ActionResult behave(TextObject to)
If the action is completed, update current action.
behave
in interface Action
behave
in class AbstractAction
public void complete(TextObject to)
complete
in interface Action
complete
in class AbstractAction
public java.util.Map<java.lang.String,Property> getRequiredProperties()
getRequiredProperties
in interface Action
getRequiredProperties
in class AbstractAction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |