198 private static final class CppProxy
extends RouteManager
200 private final long nativeRef;
201 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
203 private CppProxy(
long nativeRef)
205 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
206 this.nativeRef = nativeRef;
209 private native
void nativeDestroy(
long nativeRef);
210 public void _djinni_private_destroy()
212 boolean destroyed = this.destroyed.getAndSet(
true);
213 if (!destroyed) nativeDestroy(this.nativeRef);
215 protected void finalize() throws
java.lang.Throwable
217 _djinni_private_destroy();
226 assert !this.destroyed.get() :
"trying to use a destroyed object";
227 return native_makeRoute(this.nativeRef, from, to);
232 public ArrayList<RoutePath> makeRoutes(
LocationPoint from, ArrayList<LocationPoint> to)
234 assert !this.destroyed.get() :
"trying to use a destroyed object";
235 return native_makeRoutes(this.nativeRef, from, to);
237 private native ArrayList<RoutePath> native_makeRoutes(
long _nativeRef,
LocationPoint from, ArrayList<LocationPoint> to);
242 assert !this.destroyed.get() :
"trying to use a destroyed object";
243 native_setTarget(this.nativeRef, target);
245 private native
void native_setTarget(
long _nativeRef, LocationPoint target);
248 public void addTarget(LocationPoint target)
250 assert !this.destroyed.get() :
"trying to use a destroyed object";
251 native_addTarget(this.nativeRef, target);
253 private native
void native_addTarget(
long _nativeRef, LocationPoint target);
256 public void cancelTarget()
258 assert !this.destroyed.get() :
"trying to use a destroyed object";
259 native_cancelTarget(this.nativeRef);
261 private native
void native_cancelTarget(
long _nativeRef);
264 public void clearTargets()
266 assert !this.destroyed.get() :
"trying to use a destroyed object";
267 native_clearTargets(this.nativeRef);
269 private native
void native_clearTargets(
long _nativeRef);
272 public void setGraphTag(String tag)
274 assert !this.destroyed.get() :
"trying to use a destroyed object";
275 native_setGraphTag(this.nativeRef, tag);
277 private native
void native_setGraphTag(
long _nativeRef, String tag);
280 public String getGraphTag()
282 assert !this.destroyed.get() :
"trying to use a destroyed object";
283 return native_getGraphTag(this.nativeRef);
285 private native String native_getGraphTag(
long _nativeRef);
288 public ArrayList<String> getGraphTags()
290 assert !this.destroyed.get() :
"trying to use a destroyed object";
291 return native_getGraphTags(this.nativeRef);
293 private native ArrayList<String> native_getGraphTags(
long _nativeRef);
296 public void addRouteListener(RouteListener listener)
298 assert !this.destroyed.get() :
"trying to use a destroyed object";
299 native_addRouteListener(this.nativeRef, listener);
301 private native
void native_addRouteListener(
long _nativeRef, RouteListener listener);
304 public void removeRouteListener(RouteListener listener)
306 assert !this.destroyed.get() :
"trying to use a destroyed object";
307 native_removeRouteListener(this.nativeRef, listener);
309 private native
void native_removeRouteListener(
long _nativeRef, RouteListener listener);