@Override
 public void emit(DoubleOption option) throws IOException {
   startCell();
   if (emitNull(option)) {
     return;
   }
   lineBuffer.append(option.get());
 }
Exemple #2
0
 @SuppressWarnings("deprecation")
 private void fill0(DoubleOption option, boolean doRecover) throws CsvFormatException {
   if (lineBuffer.hasRemaining()) {
     try {
       double value = Double.parseDouble(lineBuffer.toString());
       option.modify(value);
     } catch (NumberFormatException e) {
       if (doRecover && trimWhitespaces()) {
         fill0(option, false);
         return;
       }
       throw new CsvFormatException(
           createStatusInLine(Reason.INVALID_CELL_FORMAT, "double value"), e);
     }
   } else {
     option.setNull();
   }
 }