org.commonreality.sensors.handlers
Class AbstractCommandHandlerDelegate

java.lang.Object
  extended by org.commonreality.sensors.handlers.AbstractCommandHandlerDelegate
All Implemented Interfaces:
ICommandHandlerDelegate
Direct Known Subclasses:
MotorCommandHandler, VocalizationCommandHandler

public abstract class AbstractCommandHandlerDelegate
extends java.lang.Object
implements ICommandHandlerDelegate


Constructor Summary
AbstractCommandHandlerDelegate()
           
 
Method Summary
 boolean shouldAbort(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler handler)
          return Boolean.TRUE if the command should abort (it will already be running).
 java.lang.Object shouldAccept(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler handler)
          return Boolean.TRUE if the command should be accepted for the specified agent.
 java.lang.Object shouldStart(IEfferentCommand command, IAgentObject agent, EfferentCommandHandler handler)
          return Boolean.TRUE if the command should be started.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.commonreality.sensors.handlers.ICommandHandlerDelegate
abort, getTimingEquation, start
 

Constructor Detail

AbstractCommandHandlerDelegate

public AbstractCommandHandlerDelegate()
Method Detail

shouldAbort

public boolean shouldAbort(IEfferentCommand command,
                           IAgentObject agent,
                           EfferentCommandHandler handler)
Description copied from interface: ICommandHandlerDelegate
return Boolean.TRUE if the command should abort (it will already be running). If true, EfferentCommandHandler will next call ICommandHandlerDelegate.abort(IEfferentCommand, IAgentObject, EfferentCommandHandler) and send a state update for the command with its actual state as ABORTED

Specified by:
shouldAbort in interface ICommandHandlerDelegate
Returns:

shouldAccept

public java.lang.Object shouldAccept(IEfferentCommand command,
                                     IAgentObject agent,
                                     EfferentCommandHandler handler)
Description copied from interface: ICommandHandlerDelegate
return Boolean.TRUE if the command should be accepted for the specified agent. Any other value will be used as the explanation for the rejection of the command

Specified by:
shouldAccept in interface ICommandHandlerDelegate
Returns:

shouldStart

public java.lang.Object shouldStart(IEfferentCommand command,
                                    IAgentObject agent,
                                    EfferentCommandHandler handler)
Description copied from interface: ICommandHandlerDelegate
return Boolean.TRUE if the command should be started. Any other value will be returned as the explanation for the rejection of the command start. If this returns Boolean.TRUE, the EfferentCommandHandler will next call ICommandHandlerDelegate.start(IEfferentCommand, IAgentObject, EfferentCommandHandler) and then send a state update for the command noting that the actual state is running.

Specified by:
shouldStart in interface ICommandHandlerDelegate
Returns: