1 19 20 package jxl.biff.formula; 21 22 import jxl.Cell; 23 import jxl.biff.DoubleHelper; 24 25 28 class BooleanValue extends Operand implements ParsedThing 29 { 30 33 private boolean value; 34 35 38 public BooleanValue() 39 { 40 } 41 42 47 public BooleanValue(String s) 48 { 49 value = Boolean.valueOf(s).booleanValue(); 51 } 52 53 54 61 public int read(byte[] data, int pos) 62 { 63 value = data[pos] == 1 ? true : false; 64 return 1; 65 } 66 67 72 byte[] getBytes() 73 { 74 byte[] data = new byte[2]; 75 data[0] = Token.BOOL.getCode(); 76 data[1] = (byte) (value == true ? 1 : 0); 77 78 return data; 79 } 80 81 87 public void getString(StringBuffer buf) 88 { 89 buf.append((new Boolean (value)).toString()); 90 } 91 } 92 | Popular Tags |