77 private static final class CppProxy
extends GraphEdge
79 private final long nativeRef;
80 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
82 private CppProxy(
long nativeRef)
84 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
85 this.nativeRef = nativeRef;
88 private native
void nativeDestroy(
long nativeRef);
89 public void _djinni_private_destroy()
91 boolean destroyed = this.destroyed.getAndSet(
true);
92 if (!destroyed) nativeDestroy(this.nativeRef);
94 protected void finalize() throws
java.lang.Throwable
96 _djinni_private_destroy();
103 public Float getWeight()
105 assert !this.destroyed.get() :
"trying to use a destroyed object";
106 return native_getWeight(this.nativeRef);
108 private native Float native_getWeight(
long _nativeRef);
113 assert !this.destroyed.get() :
"trying to use a destroyed object";
114 return native_getDst(this.nativeRef);
116 private native
int native_getDst(
long _nativeRef);
121 assert !this.destroyed.get() :
"trying to use a destroyed object";
122 return native_getSrc(this.nativeRef);
124 private native
int native_getSrc(
long _nativeRef);
127 public Float getWeightCoef()
129 assert !this.destroyed.get() :
"trying to use a destroyed object";
130 return native_getWeightCoef(this.nativeRef);
132 private native Float native_getWeightCoef(
long _nativeRef);