1 16 17 package org.apache.poi.hssf.record.formula; 18 19 import org.apache.poi.util.LittleEndian; 20 import org.apache.poi.hssf.model.Workbook; 21 22 26 27 public class NameXPtg extends Ptg 28 { 29 public final static short sid = 0x39; 30 private final static int SIZE = 7; 31 private short field_1_ixals; private short field_2_ilbl; private short field_3_reserved; 35 36 private NameXPtg() { 37 } 39 40 41 42 public NameXPtg(String name) 43 { 44 } 46 47 48 49 public NameXPtg(byte[] data, int offset) 50 { 51 offset++; 52 field_1_ixals = LittleEndian.getShort(data, offset); 53 field_2_ilbl = LittleEndian.getShort(data, offset + 2); 54 field_3_reserved = LittleEndian.getShort(data, offset +4); 55 56 } 58 59 public void writeBytes(byte [] array, int offset) 60 { 61 array[ offset + 0 ] = (byte)(sid + ptgClass); 62 LittleEndian.putShort(array, offset + 1, field_1_ixals); 63 LittleEndian.putShort(array,offset+3, field_2_ilbl); 64 LittleEndian.putShort(array, offset + 5, field_3_reserved); 65 } 66 67 public int getSize() 68 { 69 return SIZE; 70 } 71 72 public String toFormulaString(Workbook book) 73 { 74 return "NO IDEA - NAME"; 75 } 76 77 public byte getDefaultOperandClass() {return Ptg.CLASS_VALUE;} 78 79 public Object clone() { 80 NameXPtg ptg = new NameXPtg(); 81 ptg.field_1_ixals = field_1_ixals; 82 ptg.field_3_reserved = field_3_reserved; 83 ptg.field_2_ilbl = field_2_ilbl; 84 ptg.setClass(ptgClass); 85 return ptg; 86 } 87 } 88 | Popular Tags |