11package org .nlogo .extensions .array ;
22
3- import org .nlogo .api .CompilerException ;
3+ import org .nlogo .core .CompilerException ;
4+ import org .nlogo .core .Syntax ;
5+ import org .nlogo .core .SyntaxJ ;
6+ import org .nlogo .core .LogoList ;
47import org .nlogo .api .LogoException ;
58import org .nlogo .api .ExtensionException ;
69import org .nlogo .api .Argument ;
7- import org .nlogo .api .Syntax ;
810import org .nlogo .api .Dump ;
911import org .nlogo .api .Context ;
10- import org .nlogo .api .LogoList ;
1112import org .nlogo .api .DefaultReporter ;
1213import org .nlogo .api .DefaultCommand ;
1314
@@ -26,7 +27,7 @@ private static class LogoArray
2627 extends java .util .ArrayList <Object >
2728 // new NetLogo data types defined by extensions must implement
2829 // this interface
29- implements org .nlogo .api .ExtensionObject {
30+ implements org .nlogo .core .ExtensionObject {
3031 private final long id ;
3132
3233 LogoArray (long id ) {
@@ -150,14 +151,14 @@ public void load(org.nlogo.api.PrimitiveManager primManager) {
150151 ///
151152
152153
153- public org .nlogo .api .ExtensionObject readExtensionObject (org .nlogo .api .ExtensionManager reader ,
154+ public org .nlogo .core .ExtensionObject readExtensionObject (org .nlogo .api .ExtensionManager reader ,
154155 String typeName , String value )
155156 throws org .nlogo .api .ExtensionException , CompilerException {
156157 String [] s = value .split (":" );
157158 long id = Long .parseLong (s [0 ]);
158159 LogoArray array = getOrCreateArrayFromId (id );
159160 if (s .length > 1 ) {
160- array .addAll ((LogoList ) reader .readFromString ("[ " + s [1 ] + " ]" ));
161+ array .addAll ((( LogoList ) reader .readFromString ("[ " + s [1 ] + " ]" )). toJava ( ));
161162 }
162163 return array ;
163164 }
@@ -173,7 +174,7 @@ private LogoArray getOrCreateArrayFromId(long id) {
173174
174175 public static class Item extends DefaultReporter {
175176 public Syntax getSyntax () {
176- return Syntax .reporterSyntax
177+ return SyntaxJ .reporterSyntax
177178 (new int []{Syntax .WildcardType (),
178179 Syntax .NumberType ()},
179180 Syntax .WildcardType ());
@@ -233,7 +234,7 @@ public void perform(Argument args[], Context context)
233234
234235 public static class Length extends DefaultReporter {
235236 public Syntax getSyntax () {
236- return Syntax .reporterSyntax
237+ return SyntaxJ .reporterSyntax
237238 (new int []{Syntax .WildcardType ()},
238239 Syntax .NumberType ());
239240 }
@@ -255,7 +256,7 @@ public Object report(Argument args[], Context context)
255256
256257 public static class ToList extends DefaultReporter {
257258 public Syntax getSyntax () {
258- return Syntax .reporterSyntax
259+ return SyntaxJ .reporterSyntax
259260 (new int []{Syntax .WildcardType ()},
260261 Syntax .ListType ());
261262 }
@@ -277,7 +278,7 @@ public Object report(Argument args[], Context context)
277278
278279 public static class FromList extends DefaultReporter {
279280 public Syntax getSyntax () {
280- return Syntax .reporterSyntax
281+ return SyntaxJ .reporterSyntax
281282 (new int []{Syntax .ListType ()},
282283 Syntax .WildcardType ());
283284 }
@@ -288,7 +289,7 @@ public String getAgentClassString() {
288289
289290 public Object report (Argument args [], Context context )
290291 throws ExtensionException , LogoException {
291- return new LogoArray (args [0 ].getList ());
292+ return new LogoArray (args [0 ].getList (). toJava () );
292293 }
293294 }
294295
0 commit comments