ubiware.core.commands
Class HasBeliefsN3Command

java.lang.Object
  extended by ubiware.core.commands.HasBeliefsN3Command
All Implemented Interfaces:
UbiwareAgentCommand<BindingsSet>

public class HasBeliefsN3Command
extends java.lang.Object
implements UbiwareAgentCommand<BindingsSet>

Command that checks whether an agent has a belief in N3 notation. When delegated, checking the getResult() only makes sense when it's for sure that performCommand has been executed. This means : use this Command only in a BlockingCommand wrapper!

Author:
Michael Cochez for UBIWARE project
See Also:
15.3.2010

Constructor Summary
HasBeliefsN3Command(ubiware.util.saplbuilder.SaplDocument document)
          Create the command with a String which will be passed to UbiwareAgent.hasBeliefsN3(String) when the command gets executed.
 
Method Summary
 BindingsSet getResult()
          Get the result of the action performed.
 void performCommand(UbiwareAgent agent)
          The code which will get executed by the agent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HasBeliefsN3Command

public HasBeliefsN3Command(ubiware.util.saplbuilder.SaplDocument document)
Create the command with a String which will be passed to UbiwareAgent.hasBeliefsN3(String) when the command gets executed.

Parameters:
document - The SaplDocument which will be used to query the agents beliefs.
Method Detail

performCommand

public void performCommand(UbiwareAgent agent)
Description copied from interface: UbiwareAgentCommand
The code which will get executed by the agent.

Specified by:
performCommand in interface UbiwareAgentCommand<BindingsSet>
Parameters:
agent - The agent which is executing the command

getResult

public BindingsSet getResult()
Description copied from interface: UbiwareAgentCommand
Get the result of the action performed. If the UbiwareAgentCommand.performCommand(UbiwareAgent) has not been executed, the behavior of this method is undefined.

Specified by:
getResult in interface UbiwareAgentCommand<BindingsSet>
Returns:
The result of the performed action