org.nlogo.api
Interface Reporter

All Superinterfaces:
Primitive
All Known Implementing Classes:
DefaultReporter

public interface Reporter
extends Primitive

Interface for NetLogo reporters. Reporters are primitives that return a value. All new reporters must implement this interface.

Note that NetLogo will not call your contructor directly, it will call newInstance(String) instead.


Method Summary
 Reporter newInstance(String name)
          Returns a new instance of this Reporter.
 Object report(Argument[] args, Context context)
          Executes this Reporter.
 
Methods inherited from interface org.nlogo.api.Primitive
getAgentClassString, getSyntax
 

Method Detail

newInstance

Reporter newInstance(String name)
Returns a new instance of this Reporter. Called by NetLogo every time this Reporter is encountered during compilation.

Parameters:
name - the name that was found in the code (without the JAR identifer)
Returns:
the Reporter to be called during runtime

report

Object report(Argument[] args,
              Context context)
              throws ExtensionException,
                     LogoException
Executes this Reporter. Called by NetLogo when this Reporter is called in a running NetLogo model.

Parameters:
args - The Arguments that were included with the command in the NetLogo code. (May be a Reporter or a constant.)
context - The current Context allows access to NetLogo internal methods.
Returns:
the object to be reported
Throws:
ExtensionException
LogoException