public interface ClassManager
Interface specifies the main class of a NetLogo extension. All NetLogo extensions must include a class that implements this interface. Registers primitives with NetLogo and handles extension initialization and deconstruction.
For example:
public class FibonacciExtension extends org.nlogo.api.DefaultClassManager { public void load(org.nlogo.api.PrimitiveManager primManager) { primManager.addPrimitive("first-n-fibs", new Fibonacci()); } }
Method Summary | |
---|---|
void |
load(PrimitiveManager primManager)
Loads the primitives in the extension. |
ExtensionObject |
readExtensionObject(ExtensionManager ws,
String typeName,
String stringrep)
Return a new NetLogo ExtensionObject instance of the specified typeName, initialized by stringrep |
void |
runOnce(ExtensionManager em)
Initializes the extension. |
void |
unload()
Cleans up the extension. |
Method Detail |
---|
void runOnce(ExtensionManager em) throws ExtensionException
ExtensionException
void load(PrimitiveManager primManager) throws ExtensionException
primManager
- The manager to transport the primitives to NetLogo
ExtensionException
void unload() throws ExtensionException
load
is called.
ExtensionException
ExtensionObject readExtensionObject(ExtensionManager ws, String typeName, String stringrep) throws ExtensionException
ExtensionException