ix.iplan
Class ThatcherActivityHandler

java.lang.Object
  extended by ix.ip2.ItemHandler
      extended by ix.ip2.ActivityHandler
          extended by ix.iplan.ThatcherActivityHandler

public class ThatcherActivityHandler
extends ActivityHandler

Adds expansion actions to activities based on refinements in the agent's domain.


Field Summary
protected  Agenda actAgenda
           
protected  IPlanModelManager modelManager
           
protected  Thatcher planner
           
 
Fields inherited from class ix.ip2.ItemHandler
actionDescription
 
Constructor Summary
ThatcherActivityHandler(Thatcher planner)
           
 
Method Summary
 void addHandlerActions(AgendaItem item)
          Called to add any HandlerActions that this handler regards as appropriate for the specified AgendaItem.
 boolean appliesTo(AgendaItem item)
          Gives this handler a say in whether it should add actions to an item.
 
Methods inherited from class ix.ip2.ActivityHandler
toString
 
Methods inherited from class ix.ip2.ItemHandler
getActionDescription, getSyntaxList, handle, isAutomatic, makeHandler, reviseHandlerActions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

planner

protected Thatcher planner

actAgenda

protected Agenda actAgenda

modelManager

protected IPlanModelManager modelManager
Constructor Detail

ThatcherActivityHandler

public ThatcherActivityHandler(Thatcher planner)
Method Detail

appliesTo

public boolean appliesTo(AgendaItem item)
Description copied from class: ItemHandler
Gives this handler a say in whether it should add actions to an item. If this method returns false for an AgendaItem, or the item's wantsActionsFrom method returns false for this handler, this handler will not be asked to add actions to that item.

Overrides:
appliesTo in class ItemHandler
See Also:
AgendaItem.wantsActionsFrom(ItemHandler handler)

addHandlerActions

public void addHandlerActions(AgendaItem item)
Description copied from class: ItemHandler
Called to add any HandlerActions that this handler regards as appropriate for the specified AgendaItem.

This method is called only if both this handler's ItemHandler.appliesTo(AgendaItem) and the specified item's AgendaItem.wantsActionsFrom(ItemHandler) methods return true.

The method provided by the ItemHandler class just adds an action that calls this handler's ItemHandler.handle(AgendaItem) method. This allows suitably simple handlers to avoid working directly with HandlerActions.

Note that actions are added by calling an item's AgendaItem.addAction(HandlerAction) method.

Overrides:
addHandlerActions in class ItemHandler