85 private static final class CppProxy
extends Location
87 private final long nativeRef;
88 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
90 private CppProxy(
long nativeRef)
92 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
93 this.nativeRef = nativeRef;
96 private native
void nativeDestroy(
long nativeRef);
97 public void _djinni_private_destroy()
99 boolean destroyed = this.destroyed.getAndSet(
true);
100 if (!destroyed) nativeDestroy(this.nativeRef);
102 protected void finalize() throws
java.lang.Throwable
104 _djinni_private_destroy();
113 assert !this.destroyed.get() :
"trying to use a destroyed object";
114 return native_getElevationGraph(this.nativeRef, tag);
116 private native
ElevationGraph native_getElevationGraph(
long _nativeRef, String tag);
119 public ArrayList<String> getGraphTags()
121 assert !this.destroyed.get() :
"trying to use a destroyed object";
122 return native_getGraphTags(this.nativeRef);
124 private native ArrayList<String> native_getGraphTags(
long _nativeRef);
129 assert !this.destroyed.get() :
"trying to use a destroyed object";
130 return native_getSublocationById(this.nativeRef,
id);
132 private native Sublocation native_getSublocationById(
long _nativeRef,
int id);
135 public Category getCategoryById(
int id)
137 assert !this.destroyed.get() :
"trying to use a destroyed object";
138 return native_getCategoryById(this.nativeRef,
id);
140 private native Category native_getCategoryById(
long _nativeRef,
int id);
145 assert !this.destroyed.get() :
"trying to use a destroyed object";
146 return native_getId(this.nativeRef);
148 private native
int native_getId(
long _nativeRef);
151 public int getVersion()
153 assert !this.destroyed.get() :
"trying to use a destroyed object";
154 return native_getVersion(this.nativeRef);
156 private native
int native_getVersion(
long _nativeRef);
159 public String getName()
161 assert !this.destroyed.get() :
"trying to use a destroyed object";
162 return native_getName(this.nativeRef);
164 private native String native_getName(
long _nativeRef);
167 public String getDescript()
169 assert !this.destroyed.get() :
"trying to use a destroyed object";
170 return native_getDescript(this.nativeRef);
172 private native String native_getDescript(
long _nativeRef);
175 public ArrayList<Category> getCategories()
177 assert !this.destroyed.get() :
"trying to use a destroyed object";
178 return native_getCategories(this.nativeRef);
180 private native ArrayList<Category> native_getCategories(
long _nativeRef);
183 public ArrayList<Sublocation> getSublocations()
185 assert !this.destroyed.get() :
"trying to use a destroyed object";
186 return native_getSublocations(this.nativeRef);
188 private native ArrayList<Sublocation> native_getSublocations(
long _nativeRef);
191 public boolean getModified()
193 assert !this.destroyed.get() :
"trying to use a destroyed object";
194 return native_getModified(this.nativeRef);
196 private native
boolean native_getModified(
long _nativeRef);