107 private static final class CppProxy
extends RoutePath
109 private final long nativeRef;
110 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
112 private CppProxy(
long nativeRef)
114 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
115 this.nativeRef = nativeRef;
118 private native
void nativeDestroy(
long nativeRef);
119 public void _djinni_private_destroy()
121 boolean destroyed = this.destroyed.getAndSet(
true);
122 if (!destroyed) nativeDestroy(this.nativeRef);
124 protected void finalize() throws
java.lang.Throwable
126 _djinni_private_destroy();
135 assert !this.destroyed.get() :
"trying to use a destroyed object";
136 return native_head(this.nativeRef, advance);
138 private native
RoutePath native_head(
long _nativeRef,
float advance);
143 assert !this.destroyed.get() :
"trying to use a destroyed object";
144 return native_tail(this.nativeRef, advance);
146 private native
RoutePath native_tail(
long _nativeRef,
float advance);
149 public float getLength()
151 assert !this.destroyed.get() :
"trying to use a destroyed object";
152 return native_getLength(this.nativeRef);
154 private native
float native_getLength(
long _nativeRef);
157 public ArrayList<RouteEvent> getEvents()
159 assert !this.destroyed.get() :
"trying to use a destroyed object";
160 return native_getEvents(this.nativeRef);
162 private native ArrayList<RouteEvent> native_getEvents(
long _nativeRef);
165 public ArrayList<LocationPoint> getPoints()
167 assert !this.destroyed.get() :
"trying to use a destroyed object";
168 return native_getPoints(this.nativeRef);
170 private native ArrayList<LocationPoint> native_getPoints(
long _nativeRef);