17public abstract class Zone {
53 private static final class CppProxy
extends Zone
55 private final long nativeRef;
56 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
58 private CppProxy(
long nativeRef)
60 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
61 this.nativeRef = nativeRef;
64 private native
void nativeDestroy(
long nativeRef);
65 public void _djinni_private_destroy()
67 boolean destroyed = this.destroyed.getAndSet(
true);
68 if (!destroyed) nativeDestroy(this.nativeRef);
70 protected void finalize() throws
java.lang.Throwable
72 _djinni_private_destroy();
81 assert !this.destroyed.get() :
"trying to use a destroyed object";
82 return native_getPolygon(this.nativeRef);
84 private native
Polygon native_getPolygon(
long _nativeRef);
87 public int getLocationId()
89 assert !this.destroyed.get() :
"trying to use a destroyed object";
90 return native_getLocationId(this.nativeRef);
92 private native
int native_getLocationId(
long _nativeRef);
95 public int getSublocationId()
97 assert !this.destroyed.get() :
"trying to use a destroyed object";
98 return native_getSublocationId(this.nativeRef);
100 private native
int native_getSublocationId(
long _nativeRef);
105 assert !this.destroyed.get() :
"trying to use a destroyed object";
106 return native_getId(this.nativeRef);
108 private native
int native_getId(
long _nativeRef);
111 public String getName()
113 assert !this.destroyed.get() :
"trying to use a destroyed object";
114 return native_getName(this.nativeRef);
116 private native String native_getName(
long _nativeRef);
119 public String getColor()
121 assert !this.destroyed.get() :
"trying to use a destroyed object";
122 return native_getColor(this.nativeRef);
124 private native String native_getColor(
long _nativeRef);
127 public String getAlias()
129 assert !this.destroyed.get() :
"trying to use a destroyed object";
130 return native_getAlias(this.nativeRef);
132 private native String native_getAlias(
long _nativeRef);