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.
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 . |
AgentSet |
getAgentSet()
Returns the argument as an org.nlogo.api.AgentSet . |
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 . |
Link |
getLink()
Returns the argument as a org.nlogo.api.Link . |
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 |
---|
Object get() throws ExtensionException, LogoException
Object
without type checking.
ExtensionException
LogoException
- if a LogoException occurred while evaluating this argumentAgentSet getAgentSet() throws ExtensionException, LogoException
org.nlogo.api.AgentSet
.
ExtensionException
- if the argument is not an AgentSet
LogoException
- if a LogoException occurred while evaluating this argumentAgent getAgent() throws ExtensionException, LogoException
Agent
.
ExtensionException
- if the argument is not an Agent
LogoException
- if a LogoException occurred while evaluating this argumentBoolean getBoolean() throws ExtensionException, LogoException
Boolean
ExtensionException
- if the argument is not a Boolean
LogoException
- if a LogoException occurred while evaluating this argumentboolean getBooleanValue() throws ExtensionException, LogoException
ExtensionException
- if the argument is not a boolean
LogoException
- if a LogoException occurred while evaluating this argumentint getIntValue() throws ExtensionException, LogoException
int
.
Any fractional part is discarded.
ExtensionException
- if the argument is not a number.
LogoException
- if a LogoException occurred while evaluating this argumentdouble getDoubleValue() throws ExtensionException, LogoException
double
.
ExtensionException
- if the argument is not a number.
LogoException
- if a LogoException occurred while evaluating this argumentLogoList getList() throws ExtensionException, LogoException
org.nlogo.api.LogoList
ExtensionException
- if the argument is not a LogoList
LogoException
- if a LogoException occurred while evaluating this argumentPatch getPatch() throws ExtensionException, LogoException
org.nlogo.api.Patch
ExtensionException
- if the argument is not a Patch
LogoException
- if a LogoException occurred while evaluating this argumentString getString() throws ExtensionException, LogoException
String
ExtensionException
- if the argument cannot be cast to a String
LogoException
- if a LogoException occurred while evaluating this argumentTurtle getTurtle() throws ExtensionException, LogoException
org.nlogo.api.Turtle
.
ExtensionException
- if the argument is not a Turtle
LogoException
- if a LogoException occurred while evaluating this argumentLink getLink() throws ExtensionException, LogoException
org.nlogo.api.Link
.
ExtensionException
- if the argument is not a Link
LogoException
- if a LogoException occurred while evaluating this argument