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