Ejemplo n.º 1
0
 @Override
 public void emit(FloatOption option) throws IOException {
   startCell();
   if (emitNull(option)) {
     return;
   }
   lineBuffer.append(option.get());
 }
Ejemplo n.º 2
0
 @SuppressWarnings("deprecation")
 private void fill0(FloatOption option, boolean doRecover) throws CsvFormatException {
   if (lineBuffer.hasRemaining()) {
     try {
       float value = Float.parseFloat(lineBuffer.toString());
       option.modify(value);
     } catch (NumberFormatException e) {
       if (doRecover && trimWhitespaces()) {
         fill0(option, false);
         return;
       }
       throw new CsvFormatException(
           createStatusInLine(Reason.INVALID_CELL_FORMAT, "float value"), e);
     }
   } else {
     option.setNull();
   }
 }