org.nlogo.workspace
Class ExtensionPrimitiveManager

java.lang.Object
  extended by org.nlogo.workspace.ExtensionPrimitiveManager
All Implemented Interfaces:
PrimitiveManager

public class ExtensionPrimitiveManager
extends Object
implements PrimitiveManager


Field Summary
 String name
           
 
Constructor Summary
ExtensionPrimitiveManager(String name)
           
 
Method Summary
 void addPrimitive(String name, Primitive prim)
          Adds a new primitive.
 boolean autoImportPrimitives()
           
 void autoImportPrimitives(boolean val)
          Should the primitives be automatically imported into the top-level NetLogo namespace.
 Primitive getPrimitive(String name)
          Returns the primitive associated with a name.
 Iterator<String> getPrimitiveNames()
          Returns the names of all imported primitives.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final String name
Constructor Detail

ExtensionPrimitiveManager

public ExtensionPrimitiveManager(String name)
Method Detail

addPrimitive

public void addPrimitive(String name,
                         Primitive prim)
Description copied from interface: PrimitiveManager
Adds a new primitive. The primitive remains effective as long as this model remains loaded.

Specified by:
addPrimitive in interface PrimitiveManager
Parameters:
name - the name of the primitive that will be use in NetLogo code
prim - an instance of Primitive to associate with name

getPrimitiveNames

public Iterator<String> getPrimitiveNames()
Returns the names of all imported primitives.


autoImportPrimitives

public void autoImportPrimitives(boolean val)
Description copied from interface: PrimitiveManager
Should the primitives be automatically imported into the top-level NetLogo namespace. If false, they may only be referred to in NetLogo code as "extensionname:primitive". If true, they may also optionally be referred to simply as "primitive". The default is false.

Specified by:
autoImportPrimitives in interface PrimitiveManager

autoImportPrimitives

public boolean autoImportPrimitives()
Specified by:
autoImportPrimitives in interface PrimitiveManager

getPrimitive

public Primitive getPrimitive(String name)
Returns the primitive associated with a name.

Parameters:
name - the name of the primitive
Returns:
the primitive associated with name, or null if there isn't on