org.nlogo.api
Interface Argument

All Known Implementing Classes:
Argument

public interface Argument

Interface provides access to arguments passed to the perform or report methods of a primitive at run-time.

Arguments are created by NetLogo and passed to the perform or report methods of your primitive.

See Also:
Command.perform(Argument[], Context), Reporter.report(Argument[], Context)

Method Summary
 Object get()
          Returns the argument as an Object without type checking.
 Agent getAgent()
          Returns the argument as an Agent.
 Boolean getBoolean()
          Returns the argument as a Boolean
 boolean getBooleanValue()
          Returns the value of the argument as a boolean
 double getDoubleValue()
          Returns the value of the argument as a double.
 int getIntValue()
          Returns the value of the argument as an int.
 LogoList getList()
          Returns the argument as a org.nlogo.api.LogoList
 Patch getPatch()
          Returns the argument as an org.nlogo.api.Patch
 String getString()
          Returns the argument as a String
 Turtle getTurtle()
          Returns the argument as a org.nlogo.api.Turtle.
 

Method Detail

get

Object get()
           throws ExtensionException,
                  LogoException
Returns the argument as an Object without type checking.

Throws:
ExtensionException
LogoException - if a LogoException occurred while evaluating this argument

getAgent

Agent getAgent()
               throws ExtensionException,
                      LogoException
Returns the argument as an Agent.

Throws:
ExtensionException - if the argument is not an Agent
LogoException - if a LogoException occurred while evaluating this argument

getBoolean

Boolean getBoolean()
                   throws ExtensionException,
                          LogoException
Returns the argument as a Boolean

Throws:
ExtensionException - if the argument is not a Boolean
LogoException - if a LogoException occurred while evaluating this argument

getBooleanValue

boolean getBooleanValue()
                        throws ExtensionException,
                               LogoException
Returns the value of the argument as a boolean

Throws:
ExtensionException - if the argument is not a boolean
LogoException - if a LogoException occurred while evaluating this argument

getIntValue

int getIntValue()
                throws ExtensionException,
                       LogoException
Returns the value of the argument as an int. Any fractional part is discarded.

Throws:
ExtensionException - if the argument is not a number.
LogoException - if a LogoException occurred while evaluating this argument

getDoubleValue

double getDoubleValue()
                      throws ExtensionException,
                             LogoException
Returns the value of the argument as a double.

Throws:
ExtensionException - if the argument is not a number.
LogoException - if a LogoException occurred while evaluating this argument

getList

LogoList getList()
                 throws ExtensionException,
                        LogoException
Returns the argument as a org.nlogo.api.LogoList

Throws:
ExtensionException - if the argument is not a LogoList
LogoException - if a LogoException occurred while evaluating this argument

getPatch

Patch getPatch()
               throws ExtensionException,
                      LogoException
Returns the argument as an org.nlogo.api.Patch

Throws:
ExtensionException - if the argument is not a Patch
LogoException - if a LogoException occurred while evaluating this argument

getString

String getString()
                 throws ExtensionException,
                        LogoException
Returns the argument as a String

Throws:
ExtensionException - if the argument cannot be cast to a String
LogoException - if a LogoException occurred while evaluating this argument

getTurtle

Turtle getTurtle()
                 throws ExtensionException,
                        LogoException
Returns the argument as a org.nlogo.api.Turtle.

Throws:
ExtensionException - if the argument is not a Turtle
LogoException - if a LogoException occurred while evaluating this argument