184 private static final class CppProxy
extends Location
186 private final long nativeRef;
187 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
189 private CppProxy(
long nativeRef)
191 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
192 this.nativeRef = nativeRef;
195 private native
void nativeDestroy(
long nativeRef);
196 public void _djinni_private_destroy()
198 boolean destroyed = this.destroyed.getAndSet(
true);
199 if (!destroyed) nativeDestroy(this.nativeRef);
201 protected void finalize() throws
java.lang.Throwable
203 _djinni_private_destroy();
212 assert !this.destroyed.get() :
"trying to use a destroyed object";
213 return native_getElevationGraph(this.nativeRef, tag);
215 private native
ElevationGraph native_getElevationGraph(
long _nativeRef, String tag);
218 public ArrayList<String> getGraphTags()
220 assert !this.destroyed.get() :
"trying to use a destroyed object";
221 return native_getGraphTags(this.nativeRef);
223 private native ArrayList<String> native_getGraphTags(
long _nativeRef);
228 assert !this.destroyed.get() :
"trying to use a destroyed object";
229 return native_getSublocationById(this.nativeRef,
id);
231 private native Sublocation native_getSublocationById(
long _nativeRef,
int id);
234 public Category getCategoryById(
int id)
236 assert !this.destroyed.get() :
"trying to use a destroyed object";
237 return native_getCategoryById(this.nativeRef,
id);
239 private native Category native_getCategoryById(
long _nativeRef,
int id);
244 assert !this.destroyed.get() :
"trying to use a destroyed object";
245 return native_getId(this.nativeRef);
247 private native
int native_getId(
long _nativeRef);
250 public int getVersion()
252 assert !this.destroyed.get() :
"trying to use a destroyed object";
253 return native_getVersion(this.nativeRef);
255 private native
int native_getVersion(
long _nativeRef);
258 public String getName()
260 assert !this.destroyed.get() :
"trying to use a destroyed object";
261 return native_getName(this.nativeRef);
263 private native String native_getName(
long _nativeRef);
266 public String getDescript()
268 assert !this.destroyed.get() :
"trying to use a destroyed object";
269 return native_getDescript(this.nativeRef);
271 private native String native_getDescript(
long _nativeRef);
274 public ArrayList<Category> getCategories()
276 assert !this.destroyed.get() :
"trying to use a destroyed object";
277 return native_getCategories(this.nativeRef);
279 private native ArrayList<Category> native_getCategories(
long _nativeRef);
282 public ArrayList<Sublocation> getSublocations()
284 assert !this.destroyed.get() :
"trying to use a destroyed object";
285 return native_getSublocations(this.nativeRef);
287 private native ArrayList<Sublocation> native_getSublocations(
long _nativeRef);
290 public boolean getModified()
292 assert !this.destroyed.get() :
"trying to use a destroyed object";
293 return native_getModified(this.nativeRef);
295 private native
boolean native_getModified(
long _nativeRef);