org.nlogo.api
Interface Primitive

All Known Subinterfaces:
Command, Reporter
All Known Implementing Classes:
DefaultCommand, DefaultReporter

public interface Primitive

Top-level interface for primitives (commands or reporters). Not to be implemented directly; the Command or Reporter interface should be used instead.

See Also:
Command, Reporter

Method Summary
 String getAgentClassString()
          Returns a String which specifies in which context this primitive is allowed.
 Syntax getSyntax()
          Returns Syntax which specifies the syntax that is acceptable for this primitive.
 

Method Detail

getAgentClassString

String getAgentClassString()
Returns a String which specifies in which context this primitive is allowed. To specify observer use "O", to specify Turtle use "T", and to specify Patch use "P". To use combinations, put them togther.

Examples:

For a primitive that is allowed in all contexts,

 String getAgentClassString() { return "OTP"; }

For a primitive that is allowed only in a turtle context,

 String getAgentClassString() { return "T"; }

Returns:
a String specifying the acceptable context.

getSyntax

Syntax getSyntax()
Returns Syntax which specifies the syntax that is acceptable for this primitive. Used by the compiler for type-checking.

Returns:
the Syntax for the primitive.
See Also:
Syntax