-
-
Notifications
You must be signed in to change notification settings - Fork 237
/
Argument.scala
158 lines (141 loc) · 5.29 KB
/
Argument.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// (C) Uri Wilensky. https://github.com/NetLogo/NetLogo
package org.nlogo.api
/**
* Interface provides access to arguments passed to the <code>perform</code> or <code>report</code>
* methods of a primitive at run-time.
*
* <code>Arguments</code> are created by NetLogo and passed to the <code>perform</code> or
* <code>report</code> methods of your primitive.
*
* @see Command#perform(Argument[], Context)
* @see Reporter#report(Argument[], Context)
*/
trait Argument {
/**
* Returns the argument as an <code>Object</code> without type checking.
*
* @throws ExtensionException
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def get: AnyRef
/**
* Returns the argument as an <code>org.nlogo.api.AgentSet</code>.
*
* @throws ExtensionException if the argument is not an <code>AgentSet</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getAgentSet: AgentSet
/**
* Returns the argument as an <code>Agent</code>.
*
* @throws ExtensionException if the argument is not an <code>Agent</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getAgent: Agent
/**
* Returns the argument as a boxed <code>java.lang.Boolean</code>
*
* @throws ExtensionException if the argument is not a <code>Boolean</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getBoolean: java.lang.Boolean
/**
* Returns the value of the argument as an unboxed <code>boolean</code>.
*
* @throws ExtensionException if the argument is not a <code>boolean</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getBooleanValue: Boolean
/**
* Returns the value of the argument as an unboxed <code>int</code>.
* Any fractional part is discarded.
*
* @throws ExtensionException if the argument is not a number.
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getIntValue: Int
/**
* Returns the value of the argument as an unboxed <code>double</code>.
*
* @throws ExtensionException if the argument is not a number.
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getDoubleValue: Double
/**
* Returns the argument as a <code>org.nlogo.api.LogoList</code>
*
* @throws ExtensionException if the argument is not a <code>LogoList</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getList: LogoList
/**
* Returns the argument as an <code>org.nlogo.api.Patch</code>
*
* @throws ExtensionException if the argument is not a <code>Patch</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getPatch: Patch
/**
* Returns the argument as a <code>String</code>
*
* @throws ExtensionException if the argument cannot be cast to a <code>String</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getString: String
/**
* Returns the argument as a <code>org.nlogo.api.Turtle</code>.
*
* @throws ExtensionException if the argument is not a <code>Turtle</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getTurtle: Turtle
/**
* Returns the argument as a <code>org.nlogo.api.Link</code>.
*
* @throws ExtensionException if the argument is not a <code>Link</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getLink: Link
/**
* Returns the argument as a <code>org.nlogo.api.ReporterTask</code>.
*
* @throws ExtensionException if the argument is not a <code>ReporterTask</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getReporterTask: ReporterTask
/**
* Returns the argument as a <code>org.nlogo.api.CommandTask</code>.
*
* @throws ExtensionException if the argument is not a <code>CommandTask</code>
* @throws LogoException if a LogoException occurred while evaluating this argument
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def getCommandTask: CommandTask
}