17public abstract class Zone {
116 private static final class CppProxy
extends Zone
118 private final long nativeRef;
119 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
121 private CppProxy(
long nativeRef)
123 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
124 this.nativeRef = nativeRef;
127 private native
void nativeDestroy(
long nativeRef);
128 public void _djinni_private_destroy()
130 boolean destroyed = this.destroyed.getAndSet(
true);
131 if (!destroyed) nativeDestroy(this.nativeRef);
133 protected void finalize() throws
java.lang.Throwable
135 _djinni_private_destroy();
144 assert !this.destroyed.get() :
"trying to use a destroyed object";
145 return native_getPolygon(this.nativeRef);
147 private native
Polygon native_getPolygon(
long _nativeRef);
150 public int getLocationId()
152 assert !this.destroyed.get() :
"trying to use a destroyed object";
153 return native_getLocationId(this.nativeRef);
155 private native
int native_getLocationId(
long _nativeRef);
158 public int getSublocationId()
160 assert !this.destroyed.get() :
"trying to use a destroyed object";
161 return native_getSublocationId(this.nativeRef);
163 private native
int native_getSublocationId(
long _nativeRef);
168 assert !this.destroyed.get() :
"trying to use a destroyed object";
169 return native_getId(this.nativeRef);
171 private native
int native_getId(
long _nativeRef);
174 public String getName()
176 assert !this.destroyed.get() :
"trying to use a destroyed object";
177 return native_getName(this.nativeRef);
179 private native String native_getName(
long _nativeRef);
182 public String getColor()
184 assert !this.destroyed.get() :
"trying to use a destroyed object";
185 return native_getColor(this.nativeRef);
187 private native String native_getColor(
long _nativeRef);
190 public String getAlias()
192 assert !this.destroyed.get() :
"trying to use a destroyed object";
193 return native_getAlias(this.nativeRef);
195 private native String native_getAlias(
long _nativeRef);