1 19 20 package jxl.read.biff; 21 22 import common.Assert; 23 24 import jxl.BooleanCell; 25 import jxl.CellType; 26 import jxl.biff.FormattingRecords; 27 28 31 class BooleanRecord extends CellValue implements BooleanCell 32 { 33 36 private boolean error; 37 38 42 private boolean value; 43 44 51 public BooleanRecord(Record t, FormattingRecords fr, SheetImpl si) 52 { 53 super(t, fr, si); 54 error = false; 55 value = false; 56 57 byte[] data = getRecord().getData(); 58 59 error = (data[7] == 1); 60 61 if (!error) 62 { 63 value = data[6] == 1 ? true : false; 64 } 65 } 66 67 73 public boolean isError() 74 { 75 return error; 76 } 77 78 86 public boolean getValue() 87 { 88 return value; 89 } 90 91 96 public String getContents() 97 { 98 Assert.verify(!isError()); 99 100 return (new Boolean (value)).toString(); 102 } 103 104 109 public CellType getType() 110 { 111 return CellType.BOOLEAN; 112 } 113 114 120 public Record getRecord() 121 { 122 return super.getRecord(); 123 } 124 } 125 126 127 128 129 130 131 | Popular Tags |