28 public abstract ArrayList<GraphEdge>
getEdges();
30 private static final class CppProxy
extends Graph
32 private final long nativeRef;
33 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
35 private CppProxy(
long nativeRef)
37 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
38 this.nativeRef = nativeRef;
41 private native
void nativeDestroy(
long nativeRef);
42 public void _djinni_private_destroy()
44 boolean destroyed = this.destroyed.getAndSet(
true);
45 if (!destroyed) nativeDestroy(this.nativeRef);
47 protected void finalize() throws
java.lang.Throwable
49 _djinni_private_destroy();
56 public ArrayList<GraphVertex> getVertexes()
58 assert !this.destroyed.get() :
"trying to use a destroyed object";
59 return native_getVertexes(this.nativeRef);
61 private native ArrayList<GraphVertex> native_getVertexes(
long _nativeRef);
64 public ArrayList<GraphEdge> getEdges()
66 assert !this.destroyed.get() :
"trying to use a destroyed object";
67 return native_getEdges(this.nativeRef);
69 private native ArrayList<GraphEdge> native_getEdges(
long _nativeRef);