22 public abstract ArrayList<GraphEdge>
getEdges();
26 private final long nativeRef;
27 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
29 private CppProxy(
long nativeRef)
31 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
32 this.nativeRef = nativeRef;
35 private native
void nativeDestroy(
long nativeRef);
36 public void _djinni_private_destroy()
38 boolean destroyed = this.destroyed.getAndSet(
true);
39 if (!destroyed) nativeDestroy(this.nativeRef);
41 protected void finalize() throws
java.lang.Throwable
43 _djinni_private_destroy();
50 public ArrayList<GraphEdge> getEdges()
52 assert !this.destroyed.get() :
"trying to use a destroyed object";
53 return native_getEdges(this.nativeRef);
55 private native ArrayList<GraphEdge> native_getEdges(
long _nativeRef);