package com.bytedance.ies.nle.editor_jni;

import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.util.AbstractList;
import java.util.RandomAccess;

public class VecNLESegmentSPtr extends AbstractList<NLESegment> implements RandomAccess {
    public transient boolean LIZ;
    public transient long LIZIZ;

    static {
        Covode.recordClassIndex(29951);
    }

    public void finalize() {
        LIZ();
    }

    public VecNLESegmentSPtr() {
        this(NLEEditorJniJNI.new_VecNLESegmentSPtr__SWIG_0());
        MethodCollector.i(11086);
        MethodCollector.o(11086);
    }

    public void clear() {
        MethodCollector.i(11088);
        NLEEditorJniJNI.VecNLESegmentSPtr_clear(this.LIZIZ, this);
        MethodCollector.o(11088);
    }

    public boolean isEmpty() {
        MethodCollector.i(11087);
        boolean VecNLESegmentSPtr_isEmpty = NLEEditorJniJNI.VecNLESegmentSPtr_isEmpty(this.LIZIZ, this);
        MethodCollector.o(11087);
        return VecNLESegmentSPtr_isEmpty;
    }

    public int size() {
        MethodCollector.i(11084);
        int VecNLESegmentSPtr_doSize = NLEEditorJniJNI.VecNLESegmentSPtr_doSize(this.LIZIZ, this);
        MethodCollector.o(11084);
        return VecNLESegmentSPtr_doSize;
    }

    private synchronized void LIZ() {
        MethodCollector.i(10052);
        long j = this.LIZIZ;
        if (j != 0) {
            if (this.LIZ) {
                this.LIZ = false;
                NLEEditorJniJNI.delete_VecNLESegmentSPtr(j);
            }
            this.LIZIZ = 0;
        }
        MethodCollector.o(10052);
    }

    public VecNLESegmentSPtr(long j) {
        this.LIZ = true;
        this.LIZIZ = j;
    }

    public /* synthetic */ Object get(int i) {
        MethodCollector.i(19379);
        long VecNLESegmentSPtr_doGet = NLEEditorJniJNI.VecNLESegmentSPtr_doGet(this.LIZIZ, this, i);
        if (VecNLESegmentSPtr_doGet == 0) {
            MethodCollector.o(19379);
            return null;
        }
        NLESegment nLESegment = new NLESegment(VecNLESegmentSPtr_doGet);
        MethodCollector.o(19379);
        return nLESegment;
    }

    public /* synthetic */ boolean add(Object obj) {
        MethodCollector.i(17939);
        NLESegment nLESegment = (NLESegment) obj;
        this.modCount++;
        NLEEditorJniJNI.VecNLESegmentSPtr_doAdd__SWIG_0(this.LIZIZ, this, NLESegment.LIZ(nLESegment), nLESegment);
        MethodCollector.o(17939);
        return true;
    }

    public /* synthetic */ Object remove(int i) {
        MethodCollector.i(11091);
        this.modCount++;
        long VecNLESegmentSPtr_doRemove = NLEEditorJniJNI.VecNLESegmentSPtr_doRemove(this.LIZIZ, this, i);
        if (VecNLESegmentSPtr_doRemove == 0) {
            MethodCollector.o(11091);
            return null;
        }
        NLESegment nLESegment = new NLESegment(VecNLESegmentSPtr_doRemove);
        MethodCollector.o(11091);
        return nLESegment;
    }

    public /* synthetic */ void add(int i, Object obj) {
        MethodCollector.i(19366);
        NLESegment nLESegment = (NLESegment) obj;
        this.modCount++;
        NLEEditorJniJNI.VecNLESegmentSPtr_doAdd__SWIG_1(this.LIZIZ, this, i, NLESegment.LIZ(nLESegment), nLESegment);
        MethodCollector.o(19366);
    }

    public void removeRange(int i, int i2) {
        MethodCollector.i(11082);
        this.modCount++;
        NLEEditorJniJNI.VecNLESegmentSPtr_doRemoveRange(this.LIZIZ, this, i, i2);
        MethodCollector.o(11082);
    }

    public /* synthetic */ Object set(int i, Object obj) {
        MethodCollector.i(19377);
        NLESegment nLESegment = (NLESegment) obj;
        long VecNLESegmentSPtr_doSet = NLEEditorJniJNI.VecNLESegmentSPtr_doSet(this.LIZIZ, this, i, NLESegment.LIZ(nLESegment), nLESegment);
        if (VecNLESegmentSPtr_doSet == 0) {
            MethodCollector.o(19377);
            return null;
        }
        NLESegment nLESegment2 = new NLESegment(VecNLESegmentSPtr_doSet);
        MethodCollector.o(19377);
        return nLESegment2;
    }
}
