17public abstract class Zone {
123 private static final class CppProxy
extends Zone
125 private final long nativeRef;
126 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
128 private CppProxy(
long nativeRef)
130 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
131 this.nativeRef = nativeRef;
134 private native
void nativeDestroy(
long nativeRef);
135 public void _djinni_private_destroy()
137 boolean destroyed = this.destroyed.getAndSet(
true);
138 if (!destroyed) nativeDestroy(this.nativeRef);
140 protected void finalize() throws
java.lang.Throwable
142 _djinni_private_destroy();
151 assert !this.destroyed.get() :
"trying to use a destroyed object";
152 return native_getPolygon(this.nativeRef);
154 private native
Polygon native_getPolygon(
long _nativeRef);
157 public int getLocationId()
159 assert !this.destroyed.get() :
"trying to use a destroyed object";
160 return native_getLocationId(this.nativeRef);
162 private native
int native_getLocationId(
long _nativeRef);
165 public int getSublocationId()
167 assert !this.destroyed.get() :
"trying to use a destroyed object";
168 return native_getSublocationId(this.nativeRef);
170 private native
int native_getSublocationId(
long _nativeRef);
175 assert !this.destroyed.get() :
"trying to use a destroyed object";
176 return native_getId(this.nativeRef);
178 private native
int native_getId(
long _nativeRef);
181 public String getName()
183 assert !this.destroyed.get() :
"trying to use a destroyed object";
184 return native_getName(this.nativeRef);
186 private native String native_getName(
long _nativeRef);
189 public String getColor()
191 assert !this.destroyed.get() :
"trying to use a destroyed object";
192 return native_getColor(this.nativeRef);
194 private native String native_getColor(
long _nativeRef);
197 public String getAlias()
199 assert !this.destroyed.get() :
"trying to use a destroyed object";
200 return native_getAlias(this.nativeRef);
202 private native String native_getAlias(
long _nativeRef);