org.nlogo.api
Interface ClassManager

All Known Implementing Classes:
DefaultClassManager

public interface ClassManager


Method Summary
 List<String> additionalJars()
           
 void clearAll()
          Clear any stored state
 StringBuilder exportWorld()
          Write any state needed to restore the world.
 void importWorld(List<String[]> lines, ExtensionManager reader, ImportErrorHandler handler)
          Reload any state saved in an export world file
 void load(PrimitiveManager primManager)
          Loads the primitives in the extension.
 ExtensionObject readExtensionObject(ExtensionManager reader, String typeName, String value)
          Return a new NetLogo ExtensionObject
 void runOnce(ExtensionManager em)
          Initializes the extension.
 void unload()
          Cleans up the extension.
 

Method Detail

runOnce

void runOnce(ExtensionManager em)
             throws ExtensionException
Initializes the extension. This is called once per NetLogo instance.

Throws:
ExtensionException

load

void load(PrimitiveManager primManager)
          throws ExtensionException
Loads the primitives in the extension. This is called each time a model that uses this extension is compiled.

Parameters:
primManager - The manager to transport the primitives to NetLogo
Throws:
ExtensionException

unload

void unload()
            throws ExtensionException
Cleans up the extension. This is called once before load is called and once before NetLogo is closed or another model is opened.

Throws:
ExtensionException

readExtensionObject

ExtensionObject readExtensionObject(ExtensionManager reader,
                                    String typeName,
                                    String value)
                                    throws ExtensionException,
                                           CompilerException
Return a new NetLogo ExtensionObject

Parameters:
reader - An interface that allows the extension to read NetLogo objects
typeName - The type of ExtensionObject to be returned
value - The string representation of the object
Throws:
ExtensionException
CompilerException

exportWorld

StringBuilder exportWorld()
Write any state needed to restore the world.

Returns:
a StringBuilder containing all the data to export if the StringBuilder is empty no section is written

importWorld

void importWorld(List<String[]> lines,
                 ExtensionManager reader,
                 ImportErrorHandler handler)
                 throws ExtensionException
Reload any state saved in an export world file

Parameters:
lines - A list of lines exported by this extension the lines are broken up into an array delimited by commas
reader - An interface that allows the extension to read NetLogo objects
handler - An interface that allows the extensions to report non-fatal errors during the import
Throws:
ExtensionException

clearAll

void clearAll()
Clear any stored state


additionalJars

List<String> additionalJars()