55 public abstract void commitChanges();
57 public abstract void revertChanges();
71 private final long nativeRef;
72 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
74 private CppProxy(
long nativeRef)
76 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
77 this.nativeRef = nativeRef;
80 private native
void nativeDestroy(
long nativeRef);
81 public void _djinni_private_destroy()
83 boolean destroyed = this.destroyed.getAndSet(
true);
84 if (!destroyed) nativeDestroy(this.nativeRef);
86 protected void finalize() throws
java.lang.Throwable
88 _djinni_private_destroy();
97 assert !this.destroyed.get() :
"trying to use a destroyed object";
98 native_addLocationListener(this.nativeRef, listener);
100 private native
void native_addLocationListener(
long _nativeRef,
LocationListener listener);
105 assert !this.destroyed.get() :
"trying to use a destroyed object";
106 native_removeLocationListener(this.nativeRef, listener);
108 private native
void native_removeLocationListener(
long _nativeRef,
LocationListener listener);
111 public void setLocationId(
int locationId)
113 assert !this.destroyed.get() :
"trying to use a destroyed object";
114 native_setLocationId(this.nativeRef, locationId);
116 private native
void native_setLocationId(
long _nativeRef,
int locationId);
119 public int getLocationId()
121 assert !this.destroyed.get() :
"trying to use a destroyed object";
122 return native_getLocationId(this.nativeRef);
124 private native
int native_getLocationId(
long _nativeRef);
127 public void commitChanges()
129 assert !this.destroyed.get() :
"trying to use a destroyed object";
130 native_commitChanges(this.nativeRef);
132 private native
void native_commitChanges(
long _nativeRef);
135 public void revertChanges()
137 assert !this.destroyed.get() :
"trying to use a destroyed object";
138 native_revertChanges(this.nativeRef);
140 private native
void native_revertChanges(
long _nativeRef);
143 public void setLocationUpdateInterval(
int interval)
145 assert !this.destroyed.get() :
"trying to use a destroyed object";
146 native_setLocationUpdateInterval(this.nativeRef, interval);
148 private native
void native_setLocationUpdateInterval(
long _nativeRef,
int interval);