package jxl.read.biff;

import common.Logger;
import jxl.WorkbookSettings;
import jxl.biff.IntegerHelper;
import jxl.biff.RecordData;

/* JADX INFO: loaded from: classes.dex */
public class ExternalSheetRecord extends RecordData {
    public static Biff7 biff7;
    public static /* synthetic */ Class class$jxl$read$biff$ExternalSheetRecord;
    private static Logger logger;
    private XTI[] xtiArray;

    public static class Biff7 {
        private Biff7() {
        }
    }

    public static class XTI {
        public int firstTab;
        public int lastTab;
        public int supbookIndex;

        public XTI(int i2, int i3, int i4) {
            this.supbookIndex = i2;
            this.firstTab = i3;
            this.lastTab = i4;
        }
    }

    static {
        Class clsClass$ = class$jxl$read$biff$ExternalSheetRecord;
        if (clsClass$ == null) {
            clsClass$ = class$("jxl.read.biff.ExternalSheetRecord");
            class$jxl$read$biff$ExternalSheetRecord = clsClass$;
        }
        logger = Logger.getLogger(clsClass$);
        biff7 = new Biff7();
    }

    public ExternalSheetRecord(Record record, WorkbookSettings workbookSettings) {
        super(record);
        byte[] data = getRecord().getData();
        int i2 = IntegerHelper.getInt(data[0], data[1]);
        int i3 = 2;
        if (data.length < (i2 * 6) + 2) {
            this.xtiArray = new XTI[0];
            logger.warn("Could not process external sheets.  Formulas may be compromised.");
            return;
        }
        this.xtiArray = new XTI[i2];
        for (int i4 = 0; i4 < i2; i4++) {
            this.xtiArray[i4] = new XTI(IntegerHelper.getInt(data[i3], data[i3 + 1]), IntegerHelper.getInt(data[i3 + 2], data[i3 + 3]), IntegerHelper.getInt(data[i3 + 4], data[i3 + 5]));
            i3 += 6;
        }
    }

    public static /* synthetic */ Class class$(String str) {
        try {
            return Class.forName(str);
        } catch (ClassNotFoundException e2) {
            throw new NoClassDefFoundError(e2.getMessage());
        }
    }

    public byte[] getData() {
        return getRecord().getData();
    }

    public int getFirstTabIndex(int i2) {
        return this.xtiArray[i2].firstTab;
    }

    public int getLastTabIndex(int i2) {
        return this.xtiArray[i2].lastTab;
    }

    public int getNumRecords() {
        XTI[] xtiArr = this.xtiArray;
        if (xtiArr != null) {
            return xtiArr.length;
        }
        return 0;
    }

    public int getSupbookIndex(int i2) {
        return this.xtiArray[i2].supbookIndex;
    }

    public ExternalSheetRecord(Record record, WorkbookSettings workbookSettings, Biff7 biff72) {
        super(record);
        logger.warn("External sheet record for Biff 7 not supported");
    }
}
