-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathRefCounted.java
More file actions
34 lines (27 loc) · 874 Bytes
/
RefCounted.java
File metadata and controls
34 lines (27 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package io.github.humbleui.jwm.impl;
import org.jetbrains.annotations.ApiStatus;
public abstract class RefCounted extends Managed {
@ApiStatus.Internal
public RefCounted(long ptr) {
super(ptr, _FinalizerHolder.PTR);
}
@ApiStatus.Internal
public RefCounted(long ptr, boolean allowClose) {
super(ptr, _FinalizerHolder.PTR, allowClose);
}
public native int getRefCount();
@Override
public String toString() {
String s = super.toString();
try {
return s.substring(0, s.length() - 1) + ", refCount=" + getRefCount() + ")";
} catch (Throwable t) {
return s;
}
}
@ApiStatus.Internal
public static class _FinalizerHolder {
public static final long PTR = _nGetFinalizer();
}
@ApiStatus.Internal public static native long _nGetFinalizer();
}