|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.nexttext.behaviour.AbstractAction
public abstract class AbstractAction
An implementation of Action
with some broadly useful functionality.
Abstract Action provides:
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action |
---|
Action.ActionResult |
Constructor Summary | |
---|---|
AbstractAction()
|
Method Summary | |
---|---|
Action.ActionResult |
behave(TextObject to)
Default behave method for single objects. |
Action.ActionResult |
behave(TextObject[] to)
Default behave method for object arrays. |
Action.ActionResult |
behave(TextObject toA,
TextObject toB)
Default behave method for object pairs. |
void |
complete(TextObject to)
Default implementation which removes state information for the object. |
java.lang.String |
getDisplayName()
Returns the display name of this instance. |
java.util.Map<java.lang.String,Property> |
getRequiredProperties()
The properties that this action requires on a TextObject. |
Behaviour |
makeBehaviour()
Creates a new Behaviour and wraps this action in it. |
PropertySet |
properties()
Exposes this Action's property set. |
void |
setDisplayName(java.lang.String name)
Sets the display name of this Action instance. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAction()
Method Detail |
---|
public void setDisplayName(java.lang.String name)
Setting the empty string will return it to the default value, which is the name of the Action class.
public java.lang.String getDisplayName()
public PropertySet properties()
PropertySet
public Action.ActionResult behave(TextObject to)
This method does nothing; it should be overriden by subclasses if they wish to support actions on single objects.
Trying to call this method on an Action which doesn't override it will throw an UnsupportedActionException.
behave
in interface Action
UnsupportedActionException
public Action.ActionResult behave(TextObject toA, TextObject toB)
This method does nothing; it should be overriden by subclasses if they wish to support actions on pairs of objects.
Trying to call this method on an Action which doesn't override it will throw an UnsupportedActionException.
behave
in interface Action
UnsupportedActionException
public Action.ActionResult behave(TextObject[] to)
behave
in interface Action
UnsupportedActionException
public void complete(TextObject to)
complete
in interface Action
public java.util.Map<java.lang.String,Property> getRequiredProperties()
Right now this method always returns an empty map, since basic Actions should be restricted to use only the core set of TextObject properties.
If a subclass of Action requires a set of additional properties then it should override this method and return the appropriate Map containing the property objects.
This method is required by the Action
interface.
getRequiredProperties
in interface Action
public Behaviour makeBehaviour()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |