net.nexttext.behaviour.control
Class Descend
java.lang.Object
net.nexttext.behaviour.AbstractAction
net.nexttext.behaviour.control.Descend
- All Implemented Interfaces:
- Action
public class Descend
- extends AbstractAction
Perform the given action on the TextObject's descendants.
The given action is not performed on the TextObject passed to the behave
method, but rather on its descendants. The number of levels to descend can
be specified upon construction. If the TextObject has no descendants at the
appropriate level, then nothing is done.
Constructor Summary |
Descend(Action descendantAction)
|
Descend(Action descendantAction,
int depth)
Construct a new Descend action with the given action and depth. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Descend
public Descend(Action descendantAction)
Descend
public Descend(Action descendantAction,
int depth)
- Construct a new Descend action with the given action and depth.
- Parameters:
depth
- is a non-negative integer indicating the number of levels
to descend in the TextObject hierarchy to get the TextObjects to be
acted on.
behave
public Action.ActionResult behave(TextObject to)
- Apply the given action to the TextObject's descendants.
The results of the action calls are combined using the method
described in Action.ActionResult.
- Specified by:
behave
in interface Action
- Overrides:
behave
in class AbstractAction
complete
public void complete(TextObject to)
- End this action for this object.
- Specified by:
complete
in interface Action
- Overrides:
complete
in class AbstractAction