110 private static final class CppProxy
extends RouteManager
112 private final long nativeRef;
113 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
115 private CppProxy(
long nativeRef)
117 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
118 this.nativeRef = nativeRef;
121 private native
void nativeDestroy(
long nativeRef);
122 public void _djinni_private_destroy()
124 boolean destroyed = this.destroyed.getAndSet(
true);
125 if (!destroyed) nativeDestroy(this.nativeRef);
127 protected void finalize() throws
java.lang.Throwable
129 _djinni_private_destroy();
138 assert !this.destroyed.get() :
"trying to use a destroyed object";
139 return native_makeRoute(this.nativeRef, from, to);
144 public ArrayList<RoutePath> makeRoutes(
LocationPoint from, ArrayList<LocationPoint> to)
146 assert !this.destroyed.get() :
"trying to use a destroyed object";
147 return native_makeRoutes(this.nativeRef, from, to);
149 private native ArrayList<RoutePath> native_makeRoutes(
long _nativeRef,
LocationPoint from, ArrayList<LocationPoint> to);
154 assert !this.destroyed.get() :
"trying to use a destroyed object";
155 native_setTarget(this.nativeRef, target);
157 private native
void native_setTarget(
long _nativeRef, LocationPoint target);
160 public void addTarget(LocationPoint target)
162 assert !this.destroyed.get() :
"trying to use a destroyed object";
163 native_addTarget(this.nativeRef, target);
165 private native
void native_addTarget(
long _nativeRef, LocationPoint target);
168 public void cancelTarget()
170 assert !this.destroyed.get() :
"trying to use a destroyed object";
171 native_cancelTarget(this.nativeRef);
173 private native
void native_cancelTarget(
long _nativeRef);
176 public void clearTargets()
178 assert !this.destroyed.get() :
"trying to use a destroyed object";
179 native_clearTargets(this.nativeRef);
181 private native
void native_clearTargets(
long _nativeRef);
184 public void setGraphTag(String tag)
186 assert !this.destroyed.get() :
"trying to use a destroyed object";
187 native_setGraphTag(this.nativeRef, tag);
189 private native
void native_setGraphTag(
long _nativeRef, String tag);
192 public String getGraphTag()
194 assert !this.destroyed.get() :
"trying to use a destroyed object";
195 return native_getGraphTag(this.nativeRef);
197 private native String native_getGraphTag(
long _nativeRef);
200 public ArrayList<String> getGraphTags()
202 assert !this.destroyed.get() :
"trying to use a destroyed object";
203 return native_getGraphTags(this.nativeRef);
205 private native ArrayList<String> native_getGraphTags(
long _nativeRef);
208 public void addRouteListener(RouteListener listener)
210 assert !this.destroyed.get() :
"trying to use a destroyed object";
211 native_addRouteListener(this.nativeRef, listener);
213 private native
void native_addRouteListener(
long _nativeRef, RouteListener listener);
216 public void removeRouteListener(RouteListener listener)
218 assert !this.destroyed.get() :
"trying to use a destroyed object";
219 native_removeRouteListener(this.nativeRef, listener);
221 private native
void native_removeRouteListener(
long _nativeRef, RouteListener listener);