package com.bytedance.ies.nle.editor_jni;

import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;

public class INLEMonitor {
    public transient boolean swigCMemOwn;
    public transient long swigCPtr;

    static {
        Covode.recordClassIndex(29756);
    }

    public void finalize() {
        delete();
    }

    public void swigDirectorDisconnect() {
        swigSetCMemOwn(false);
        delete();
    }

    public INLEMonitor() {
        this(NLEEditorJniJNI.new_INLEMonitor(), true);
        MethodCollector.i(18723);
        NLEEditorJniJNI.INLEMonitor_director_connect(this, this.swigCPtr, true, true);
        MethodCollector.o(18723);
    }

    public void swigReleaseOwnership() {
        MethodCollector.i(18721);
        swigSetCMemOwn(false);
        NLEEditorJniJNI.INLEMonitor_change_ownership(this, this.swigCPtr, false);
        MethodCollector.o(18721);
    }

    public void swigTakeOwnership() {
        MethodCollector.i(18722);
        swigSetCMemOwn(true);
        NLEEditorJniJNI.INLEMonitor_change_ownership(this, this.swigCPtr, true);
        MethodCollector.o(18722);
    }

    public synchronized void delete() {
        MethodCollector.i(18720);
        long j = this.swigCPtr;
        if (j != 0) {
            if (this.swigCMemOwn) {
                this.swigCMemOwn = false;
                NLEEditorJniJNI.delete_INLEMonitor(j);
            }
            this.swigCPtr = 0;
        }
        MethodCollector.o(18720);
    }

    public void swigSetCMemOwn(boolean z) {
        this.swigCMemOwn = z;
    }

    public static long getCPtr(INLEMonitor iNLEMonitor) {
        if (iNLEMonitor == null) {
            return 0;
        }
        return iNLEMonitor.swigCPtr;
    }

    public INLEMonitor(long j, boolean z) {
        this.swigCMemOwn = z;
        this.swigCPtr = j;
    }

    public void onEvent(String str, int i, String str2, long j) {
        MethodCollector.i(18724);
        int i2 = i;
        String str3 = str;
        long j2 = j;
        String str4 = str2;
        if (getClass() == INLEMonitor.class) {
            NLEEditorJniJNI.INLEMonitor_onEvent(this.swigCPtr, this, str3, i2, str4, j2);
            MethodCollector.o(18724);
            return;
        }
        NLEEditorJniJNI.INLEMonitor_onEventSwigExplicitINLEMonitor(this.swigCPtr, this, str3, i2, str4, j2);
        MethodCollector.o(18724);
    }
}
