1 16 17 package org.apache.poi.hssf.record.formula; 18 19 import java.util.List ; 20 21 import org.apache.poi.hssf.model.Workbook; 22 23 28 29 public class UnaryMinusPtg extends OperationPtg 30 { 31 public final static int SIZE = 1; 32 public final static byte sid = 0x13; 33 34 private final static String MINUS = "-"; 35 36 37 38 public UnaryMinusPtg() 39 { 40 } 41 42 public UnaryMinusPtg(byte[] data, int offset) 43 { 44 45 } 47 48 49 public void writeBytes(byte [] array, int offset) 50 { 51 array[ offset + 0 ] = sid; 52 } 53 54 public int getSize() 55 { 56 return SIZE; 57 } 58 59 public int getType() 60 { 61 return this.TYPE_UNARY; 62 } 63 64 public int getNumberOfOperands() 65 { 66 return 1; 67 } 68 69 70 public String toFormulaString(Workbook book) 71 { 72 return "+"; 73 } 74 75 76 public String toFormulaString(String [] operands) { 77 StringBuffer buffer = new StringBuffer (); 78 buffer.append(MINUS); 79 buffer.append(operands[ 0]); 80 return buffer.toString(); 81 } 82 83 public byte getDefaultOperandClass() {return Ptg.CLASS_VALUE;} 84 85 public Object clone() { 86 return new UnaryPlusPtg(); 87 } 88 89 } 90 | Popular Tags |