1 19 20 package jxl.read.biff; 21 22 import common.Logger; 23 24 import jxl.biff.IntegerHelper; 25 import jxl.biff.RecordData; 26 27 30 class MulRKRecord extends RecordData 31 { 32 35 private static Logger logger = Logger.getLogger(MulRKRecord.class); 36 37 40 private int row; 41 44 private int colFirst; 45 48 private int colLast; 49 52 private int numrks; 53 56 private int[] rknumbers; 57 60 private int[] xfIndices; 61 62 67 public MulRKRecord(Record t) 68 { 69 super(t); 70 byte[] data = getRecord().getData(); 71 int length = getRecord().getLength(); 72 row = IntegerHelper.getInt(data[0], data[1]); 73 colFirst = IntegerHelper.getInt(data[2], data[3]); 74 colLast = IntegerHelper.getInt(data[length - 2], data[length - 1]); 75 numrks = colLast - colFirst + 1; 76 rknumbers = new int[numrks]; 77 xfIndices = new int[numrks]; 78 79 readRks(data); 80 } 81 82 87 private void readRks(byte[] data) 88 { 89 int pos = 4; 90 int rk; 91 for (int i = 0; i < numrks; i++) 92 { 93 xfIndices[i] = IntegerHelper.getInt(data[pos], data[pos + 1]); 94 rk = IntegerHelper.getInt 95 (data[pos + 2], data[pos + 3], data[pos + 4], data[pos + 5]); 96 rknumbers[i] = rk; 97 pos += 6; 98 } 99 } 100 101 106 public int getRow() 107 { 108 return row; 109 } 110 111 116 public int getFirstColumn() 117 { 118 return colFirst; 119 } 120 121 126 public int getNumberOfColumns() 127 { 128 return numrks; 129 } 130 131 137 public int getRKNumber(int index) 138 { 139 return rknumbers[index]; 140 } 141 142 148 public int getXFIndex(int index) 149 { 150 return xfIndices[index]; 151 } 152 } 153 154 155 156 157 | Popular Tags |