87 public abstract void commitChanges();
89 public abstract void revertChanges();
111 private final long nativeRef;
112 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
114 private CppProxy(
long nativeRef)
116 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
117 this.nativeRef = nativeRef;
120 private native
void nativeDestroy(
long nativeRef);
121 public void _djinni_private_destroy()
123 boolean destroyed = this.destroyed.getAndSet(
true);
124 if (!destroyed) nativeDestroy(this.nativeRef);
126 protected void finalize() throws
java.lang.Throwable
128 _djinni_private_destroy();
137 assert !this.destroyed.get() :
"trying to use a destroyed object";
138 native_addLocationListener(this.nativeRef, listener);
140 private native
void native_addLocationListener(
long _nativeRef,
LocationListener listener);
145 assert !this.destroyed.get() :
"trying to use a destroyed object";
146 native_removeLocationListener(this.nativeRef, listener);
148 private native
void native_removeLocationListener(
long _nativeRef,
LocationListener listener);
151 public void setLocationId(
int locationId)
153 assert !this.destroyed.get() :
"trying to use a destroyed object";
154 native_setLocationId(this.nativeRef, locationId);
156 private native
void native_setLocationId(
long _nativeRef,
int locationId);
159 public int getLocationId()
161 assert !this.destroyed.get() :
"trying to use a destroyed object";
162 return native_getLocationId(this.nativeRef);
164 private native
int native_getLocationId(
long _nativeRef);
167 public void commitChanges()
169 assert !this.destroyed.get() :
"trying to use a destroyed object";
170 native_commitChanges(this.nativeRef);
172 private native
void native_commitChanges(
long _nativeRef);
175 public void revertChanges()
177 assert !this.destroyed.get() :
"trying to use a destroyed object";
178 native_revertChanges(this.nativeRef);
180 private native
void native_revertChanges(
long _nativeRef);
183 public void setLocationUpdateInterval(
int interval)
185 assert !this.destroyed.get() :
"trying to use a destroyed object";
186 native_setLocationUpdateInterval(this.nativeRef, interval);
188 private native
void native_setLocationUpdateInterval(
long _nativeRef,
int interval);