48 public abstract ArrayList<GraphEdge>
getEdges();
50 private static final class CppProxy
extends Graph
52 private final long nativeRef;
53 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
55 private CppProxy(
long nativeRef)
57 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
58 this.nativeRef = nativeRef;
61 private native
void nativeDestroy(
long nativeRef);
62 public void _djinni_private_destroy()
64 boolean destroyed = this.destroyed.getAndSet(
true);
65 if (!destroyed) nativeDestroy(this.nativeRef);
67 protected void finalize() throws
java.lang.Throwable
69 _djinni_private_destroy();
76 public ArrayList<GraphVertex> getVertexes()
78 assert !this.destroyed.get() :
"trying to use a destroyed object";
79 return native_getVertexes(this.nativeRef);
81 private native ArrayList<GraphVertex> native_getVertexes(
long _nativeRef);
84 public ArrayList<GraphEdge> getEdges()
86 assert !this.destroyed.get() :
"trying to use a destroyed object";
87 return native_getEdges(this.nativeRef);
89 private native ArrayList<GraphEdge> native_getEdges(
long _nativeRef);