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 VecNLESegmentSPtrConst extends AbstractList<NLESegment> implements RandomAccess {
    public transient boolean LIZ;
    public transient long LIZIZ;

    static {
        Covode.recordClassIndex(29952);
    }

    public void finalize() {
        LIZ();
    }

    public VecNLESegmentSPtrConst() {
        this(NLEEditorJniJNI.new_VecNLESegmentSPtrConst__SWIG_0());
        MethodCollector.i(19176);
        MethodCollector.o(19176);
    }

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

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

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

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

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

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

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

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

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

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

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