87 public abstract void commitChanges();
89 public abstract void revertChanges();
113 private final long nativeRef;
114 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
116 private CppProxy(
long nativeRef)
118 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
119 this.nativeRef = nativeRef;
122 private native
void nativeDestroy(
long nativeRef);
123 public void _djinni_private_destroy()
125 boolean destroyed = this.destroyed.getAndSet(
true);
126 if (!destroyed) nativeDestroy(this.nativeRef);
128 protected void finalize() throws
java.lang.Throwable
130 _djinni_private_destroy();
139 assert !this.destroyed.get() :
"trying to use a destroyed object";
140 native_addLocationListener(this.nativeRef, listener);
142 private native
void native_addLocationListener(
long _nativeRef,
LocationListener listener);
147 assert !this.destroyed.get() :
"trying to use a destroyed object";
148 native_removeLocationListener(this.nativeRef, listener);
150 private native
void native_removeLocationListener(
long _nativeRef,
LocationListener listener);
153 public void setLocationId(
int locationId)
155 assert !this.destroyed.get() :
"trying to use a destroyed object";
156 native_setLocationId(this.nativeRef, locationId);
158 private native
void native_setLocationId(
long _nativeRef,
int locationId);
161 public int getLocationId()
163 assert !this.destroyed.get() :
"trying to use a destroyed object";
164 return native_getLocationId(this.nativeRef);
166 private native
int native_getLocationId(
long _nativeRef);
169 public void commitChanges()
171 assert !this.destroyed.get() :
"trying to use a destroyed object";
172 native_commitChanges(this.nativeRef);
174 private native
void native_commitChanges(
long _nativeRef);
177 public void revertChanges()
179 assert !this.destroyed.get() :
"trying to use a destroyed object";
180 native_revertChanges(this.nativeRef);
182 private native
void native_revertChanges(
long _nativeRef);
185 public void setLocationUpdateInterval(
int interval)
187 assert !this.destroyed.get() :
"trying to use a destroyed object";
188 native_setLocationUpdateInterval(this.nativeRef, interval);
190 private native
void native_setLocationUpdateInterval(
long _nativeRef,
int interval);