31 public abstract ArrayList<GraphEdge>
getEdges();
35 private final long nativeRef;
36 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
38 private CppProxy(
long nativeRef)
40 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
41 this.nativeRef = nativeRef;
44 private native
void nativeDestroy(
long nativeRef);
45 public void _djinni_private_destroy()
47 boolean destroyed = this.destroyed.getAndSet(
true);
48 if (!destroyed) nativeDestroy(this.nativeRef);
50 protected void finalize() throws
java.lang.Throwable
52 _djinni_private_destroy();
59 public ArrayList<GraphEdge> getEdges()
61 assert !this.destroyed.get() :
"trying to use a destroyed object";
62 return native_getEdges(this.nativeRef);
64 private native ArrayList<GraphEdge> native_getEdges(
long _nativeRef);