java.lang.Object org.nlogo.nvm.Argument
public class Argument
Passes arguments to extension primitives.
Constructor Summary | |
---|---|
Argument(Context context,
Reporter arg)
|
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 |
Reporter |
getReporter()
Special (undocumented) method for the cities extension. |
String |
getString()
Returns the argument as a String |
Turtle |
getTurtle()
Returns the argument as a org.nlogo.api.Turtle . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Argument(Context context, Reporter arg)
Method Detail |
---|
public Object get() throws LogoException
Argument
Object
without type checking.
get
in interface Argument
LogoException
- if a LogoException occurred while evaluating this argumentpublic AgentSet getAgentSet() throws ExtensionException, LogoException
Argument
org.nlogo.api.AgentSet
.
getAgentSet
in interface Argument
ExtensionException
- if the argument is not an AgentSet
LogoException
- if a LogoException occurred while evaluating this argumentpublic Agent getAgent() throws ExtensionException, LogoException
Argument
Agent
.
getAgent
in interface Argument
ExtensionException
- if the argument is not an Agent
LogoException
- if a LogoException occurred while evaluating this argumentpublic Boolean getBoolean() throws ExtensionException, LogoException
Argument
Boolean
getBoolean
in interface Argument
ExtensionException
- if the argument is not a Boolean
LogoException
- if a LogoException occurred while evaluating this argumentpublic boolean getBooleanValue() throws ExtensionException, LogoException
Argument
getBooleanValue
in interface Argument
ExtensionException
- if the argument is not a boolean
LogoException
- if a LogoException occurred while evaluating this argumentpublic double getDoubleValue() throws ExtensionException, LogoException
Argument
double
.
getDoubleValue
in interface Argument
ExtensionException
- if the argument is not a number.
LogoException
- if a LogoException occurred while evaluating this argumentpublic int getIntValue() throws ExtensionException, LogoException
Argument
int
.
Any fractional part is discarded.
getIntValue
in interface Argument
ExtensionException
- if the argument is not a number.
LogoException
- if a LogoException occurred while evaluating this argumentpublic LogoList getList() throws ExtensionException, LogoException
Argument
org.nlogo.api.LogoList
getList
in interface Argument
ExtensionException
- if the argument is not a LogoList
LogoException
- if a LogoException occurred while evaluating this argumentpublic Patch getPatch() throws ExtensionException, LogoException
Argument
org.nlogo.api.Patch
getPatch
in interface Argument
ExtensionException
- if the argument is not a Patch
LogoException
- if a LogoException occurred while evaluating this argumentpublic String getString() throws ExtensionException, LogoException
Argument
String
getString
in interface Argument
ExtensionException
- if the argument cannot be cast to a String
LogoException
- if a LogoException occurred while evaluating this argumentpublic Turtle getTurtle() throws ExtensionException, LogoException
Argument
org.nlogo.api.Turtle
.
getTurtle
in interface Argument
ExtensionException
- if the argument is not a Turtle
LogoException
- if a LogoException occurred while evaluating this argumentpublic Link getLink() throws ExtensionException, LogoException
Argument
org.nlogo.api.Link
.
getLink
in interface Argument
ExtensionException
- if the argument is not a Link
LogoException
- if a LogoException occurred while evaluating this argumentpublic Reporter getReporter()