/** * used internally -- given a cell value record, figure out its type */ private static CellType determineType(CellValueRecordInterface cval) { if (cval instanceof FormulaRecordAggregate) { return CellType.FORMULA; } // all others are plain BIFF records Record record = ( Record ) cval; switch (record.getSid()) { case NumberRecord.sid : return CellType.NUMERIC; case BlankRecord.sid : return CellType.BLANK; case LabelSSTRecord.sid : return CellType.STRING; case BoolErrRecord.sid : BoolErrRecord boolErrRecord = ( BoolErrRecord ) record; return boolErrRecord.isBoolean() ? CellType.BOOLEAN : CellType.ERROR; } throw new RuntimeException("Bad cell value rec (" + cval.getClass().getName() + ")"); }
@Override protected void appendValueText(StringBuilder sb) { if (isBoolean()) { sb.append(" .boolVal = "); sb.append(getBooleanValue()); } else { sb.append(" .errCode = "); sb.append(FormulaError.forInt(getErrorValue()).getString()); sb.append(" (").append(HexDump.byteToHex(getErrorValue())).append(")"); } } @Override
/** * used internally -- given a cell value record, figure out its type */ private static int determineType(CellValueRecordInterface cval) { if (cval instanceof FormulaRecordAggregate) { return HSSFCell.CELL_TYPE_FORMULA; } // all others are plain BIFF records Record record = ( Record ) cval; switch (record.getSid()) { case NumberRecord.sid : return HSSFCell.CELL_TYPE_NUMERIC; case BlankRecord.sid : return HSSFCell.CELL_TYPE_BLANK; case LabelSSTRecord.sid : return HSSFCell.CELL_TYPE_STRING; case BoolErrRecord.sid : BoolErrRecord boolErrRecord = ( BoolErrRecord ) record; return boolErrRecord.isBoolean() ? HSSFCell.CELL_TYPE_BOOLEAN : HSSFCell.CELL_TYPE_ERROR; } throw new RuntimeException("Bad cell value rec (" + cval.getClass().getName() + ")"); }
/** * used internally -- given a cell value record, figure out its type */ private static CellType determineType(CellValueRecordInterface cval) { if (cval instanceof FormulaRecordAggregate) { return CellType.FORMULA; } // all others are plain BIFF records Record record = ( Record ) cval; switch (record.getSid()) { case NumberRecord.sid : return CellType.NUMERIC; case BlankRecord.sid : return CellType.BLANK; case LabelSSTRecord.sid : return CellType.STRING; case BoolErrRecord.sid : BoolErrRecord boolErrRecord = ( BoolErrRecord ) record; return boolErrRecord.isBoolean() ? CellType.BOOLEAN : CellType.ERROR; } throw new RuntimeException("Bad cell value rec (" + cval.getClass().getName() + ")"); }
/** * used internally -- given a cell value record, figure out its type */ private static int determineType(CellValueRecordInterface cval) { if (cval instanceof FormulaRecordAggregate) { return HSSFCell.CELL_TYPE_FORMULA; } // all others are plain BIFF records Record record = ( Record ) cval; switch (record.getSid()) { case NumberRecord.sid : return HSSFCell.CELL_TYPE_NUMERIC; case BlankRecord.sid : return HSSFCell.CELL_TYPE_BLANK; case LabelSSTRecord.sid : return HSSFCell.CELL_TYPE_STRING; case BoolErrRecord.sid : BoolErrRecord boolErrRecord = ( BoolErrRecord ) record; return boolErrRecord.isBoolean() ? HSSFCell.CELL_TYPE_BOOLEAN : HSSFCell.CELL_TYPE_ERROR; } throw new RuntimeException("Bad cell value rec (" + cval.getClass().getName() + ")"); }
@Override protected void appendValueText(StringBuilder sb) { if (isBoolean()) { sb.append(" .boolVal = "); sb.append(getBooleanValue()); } else { sb.append(" .errCode = "); sb.append(ErrorConstants.getText(getErrorValue())); sb.append(" (").append(HexDump.byteToHex(getErrorValue())).append(")"); } } @Override
@Override protected void appendValueText(StringBuilder sb) { if (isBoolean()) { sb.append(" .boolVal = "); sb.append(getBooleanValue()); } else { sb.append(" .errCode = "); sb.append(ErrorConstants.getText(getErrorValue())); sb.append(" (").append(HexDump.byteToHex(getErrorValue())).append(")"); } } @Override
@Override protected void appendValueText(StringBuilder sb) { if (isBoolean()) { sb.append(" .boolVal = "); sb.append(getBooleanValue()); } else { sb.append(" .errCode = "); sb.append(FormulaError.forInt(getErrorValue()).getString()); sb.append(" (").append(HexDump.byteToHex(getErrorValue())).append(")"); } } @Override
case BoolErrRecord.sid: { final BoolErrRecord brec = (BoolErrRecord) cell; if (brec.isBoolean()) { return brec.getBooleanValue(); } else {
BoolErrRecord berec = (BoolErrRecord) record; if (berec.isBoolean()) {