195 private static final class CppProxy
extends Location
197 private final long nativeRef;
198 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
200 private CppProxy(
long nativeRef)
202 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
203 this.nativeRef = nativeRef;
206 private native
void nativeDestroy(
long nativeRef);
207 public void _djinni_private_destroy()
209 boolean destroyed = this.destroyed.getAndSet(
true);
210 if (!destroyed) nativeDestroy(this.nativeRef);
212 protected void finalize() throws
java.lang.Throwable
214 _djinni_private_destroy();
223 assert !this.destroyed.get() :
"trying to use a destroyed object";
224 return native_getElevationGraph(this.nativeRef, tag);
226 private native
ElevationGraph native_getElevationGraph(
long _nativeRef, String tag);
229 public ArrayList<String> getGraphTags()
231 assert !this.destroyed.get() :
"trying to use a destroyed object";
232 return native_getGraphTags(this.nativeRef);
234 private native ArrayList<String> native_getGraphTags(
long _nativeRef);
239 assert !this.destroyed.get() :
"trying to use a destroyed object";
240 return native_getSublocationById(this.nativeRef,
id);
242 private native Sublocation native_getSublocationById(
long _nativeRef,
int id);
245 public Category getCategoryById(
int id)
247 assert !this.destroyed.get() :
"trying to use a destroyed object";
248 return native_getCategoryById(this.nativeRef,
id);
250 private native Category native_getCategoryById(
long _nativeRef,
int id);
255 assert !this.destroyed.get() :
"trying to use a destroyed object";
256 return native_getId(this.nativeRef);
258 private native
int native_getId(
long _nativeRef);
261 public int getVersion()
263 assert !this.destroyed.get() :
"trying to use a destroyed object";
264 return native_getVersion(this.nativeRef);
266 private native
int native_getVersion(
long _nativeRef);
269 public String getName()
271 assert !this.destroyed.get() :
"trying to use a destroyed object";
272 return native_getName(this.nativeRef);
274 private native String native_getName(
long _nativeRef);
277 public String getDescript()
279 assert !this.destroyed.get() :
"trying to use a destroyed object";
280 return native_getDescript(this.nativeRef);
282 private native String native_getDescript(
long _nativeRef);
285 public ArrayList<Category> getCategories()
287 assert !this.destroyed.get() :
"trying to use a destroyed object";
288 return native_getCategories(this.nativeRef);
290 private native ArrayList<Category> native_getCategories(
long _nativeRef);
293 public ArrayList<Sublocation> getSublocations()
295 assert !this.destroyed.get() :
"trying to use a destroyed object";
296 return native_getSublocations(this.nativeRef);
298 private native ArrayList<Sublocation> native_getSublocations(
long _nativeRef);
301 public boolean getModified()
303 assert !this.destroyed.get() :
"trying to use a destroyed object";
304 return native_getModified(this.nativeRef);
306 private native
boolean native_getModified(
long _nativeRef);