net.nexttext.behaviour.control
Class DebugLog

java.lang.Object
  extended by net.nexttext.behaviour.AbstractAction
      extended by net.nexttext.behaviour.control.DebugLog
All Implemented Interfaces:
Action

public class DebugLog
extends AbstractAction

An action which logs the TextObjects it processes.

This action is useful for debugging, since it can be used to track the order that various actions process objects. It can be created with an action, which it will call, allowing it to be inserted anywhere in the action tree. Messages are sent to the Book's log.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action
Action.ActionResult
 
Constructor Summary
DebugLog(java.lang.String prefix)
           
DebugLog(java.lang.String prefix, Action action)
           
 
Method Summary
 Action.ActionResult behave(TextObject to)
          Default behave method for single objects.
 void complete(TextObject to)
          Default implementation which removes state information for the object.
 java.util.Map<java.lang.String,Property> getRequiredProperties()
          The properties that this action requires on a TextObject.
 
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

DebugLog

public DebugLog(java.lang.String prefix)

DebugLog

public DebugLog(java.lang.String prefix,
                Action action)
Method Detail

behave

public Action.ActionResult behave(TextObject to)
Description copied from class: AbstractAction
Default behave method for single objects.

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.

Specified by:
behave in interface Action
Overrides:
behave in class AbstractAction

getRequiredProperties

public java.util.Map<java.lang.String,Property> getRequiredProperties()
Description copied from class: AbstractAction
The properties that this action requires on a TextObject.

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.

Specified by:
getRequiredProperties in interface Action
Overrides:
getRequiredProperties in class AbstractAction

complete

public void complete(TextObject to)
Description copied from class: AbstractAction
Default implementation which removes state information for the object.

Specified by:
complete in interface Action
Overrides:
complete in class AbstractAction