org.nlogo.api
Class DefaultCommand

java.lang.Object
  extended by org.nlogo.api.DefaultCommand
All Implemented Interfaces:
Command, Primitive

public abstract class DefaultCommand
extends Object
implements Command

Partial implementation of Command provides common implentations of some methods. Implements every method except Command.perform(...).


Constructor Summary
DefaultCommand()
           
 
Method Summary
 String getAgentClassString()
          Indicates that this primitive can be used by any agent.
 boolean getSwitchesBoolean()
          Indicates that NetLogo does not need to switch agents after executing this command.
 Syntax getSyntax()
          Indicates that this command takes no arguments.
 Command newInstance(String name)
          Returns a new instance of this class, created by invoking the empty constructor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nlogo.api.Command
perform
 

Constructor Detail

DefaultCommand

public DefaultCommand()
Method Detail

getAgentClassString

public String getAgentClassString()
Indicates that this primitive can be used by any agent.

Specified by:
getAgentClassString in interface Primitive
Returns:
"OTPL"

getSyntax

public Syntax getSyntax()
Indicates that this command takes no arguments.

Specified by:
getSyntax in interface Primitive
Returns:
Syntax.commandSyntax()
See Also:
Syntax

getSwitchesBoolean

public boolean getSwitchesBoolean()
Indicates that NetLogo does not need to switch agents after executing this command.

Specified by:
getSwitchesBoolean in interface Command
Returns:
true if a switch should occur, false otherwise.

newInstance

public Command newInstance(String name)
Returns a new instance of this class, created by invoking the empty constructor.

Specified by:
newInstance in interface Command
Parameters:
name - the name that was found in the code (without the JAR identifer)
Returns:
(Command) this.getClass().newInstance()