NetLogo API
version 2.1.0

org.nlogo.api
Interface 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.
 float getFloatValue()
          Returns the value of the argument as a float.
 int getIntegerValue()
          Returns the value of the argument as an int.
 LogoList getList()
          Returns the argument as a org.nlogo.agent.LogoList
 Number getNumber()
          Returns the argument as a Number.
 Patch getPatch()
          Returns the argument as an org.nlogo.agent.Patch
 String getString()
          Returns the argument as a String
 Turtle getTurtle()
          Returns the argument as a org.nlogo.agent.Turtle.
 

Method Detail

get

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

Throws:
ExtensionException

getAgent

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

Throws:
ExtensionException - if the argument is not an Agent

getBoolean

public Boolean getBoolean()
                   throws ExtensionException
Returns the argument as a Boolean

Throws:
ExtensionException - if the argument is not a Boolean

getBooleanValue

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

Throws:
ExtensionException - if the argument is not a boolean

getDoubleValue

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

Throws:
ExtensionException - if the argument is not a double

getFloatValue

public float getFloatValue()
                    throws ExtensionException
Returns the value of the argument as a float.

Throws:
ExtensionException - if the argument is not a float

getIntegerValue

public int getIntegerValue()
                    throws ExtensionException
Returns the value of the argument as an int.

Throws:
ExtensionException - if the argument is not an int

getList

public LogoList getList()
                 throws ExtensionException
Returns the argument as a org.nlogo.agent.LogoList

Throws:
ExtensionException - if the argument is not a LogoList

getNumber

public Number getNumber()
                 throws ExtensionException
Returns the argument as a Number.

Throws:
ExtensionException - if the argument is not a Number

getPatch

public Patch getPatch()
               throws ExtensionException
Returns the argument as an org.nlogo.agent.Patch

Throws:
ExtensionException - if the argument is not a Patch

getString

public String getString()
                 throws ExtensionException
Returns the argument as a String

Throws:
ExtensionException - if the argument cannot be cast to a String

getTurtle

public Turtle getTurtle()
                 throws ExtensionException
Returns the argument as a org.nlogo.agent.Turtle.

Throws:
ExtensionException - if the argument is not a Turtle

NetLogo API
version 2.1.0