NetLogo API
version 2.0.2

org.nlogo.api
Class Argument

java.lang.Object
  extended byorg.nlogo.api.Argument

public class Argument
extends Object

Wrapper class holds an argument 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)

Constructor Summary
Argument(org.nlogo.nvm.Context context, org.nlogo.command.Reporter arg)
          Creates a new Argument.
 
Method Summary
 Object get()
          Returns the argument as an Object without type checking.
 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.
 String getString()
          Returns the argument as a String
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Argument

public Argument(org.nlogo.nvm.Context context,
                org.nlogo.command.Reporter arg)
Creates a new Argument. Called by NetLogo.

Parameters:
context -
arg -
Method Detail

get

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

Throws:
ExtensionException

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

getString

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

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

NetLogo API
version 2.0.2