(Object... args)
| 38 | } |
| 39 | |
| 40 | public void addRow(Object... args) { |
| 41 | try { |
| 42 | for (int i = 0, n = args.length; i < n; ++i) { |
| 43 | if (i > 0) { |
| 44 | mWriter.append(mFieldSeparator); |
| 45 | } |
| 46 | Object value = args[i]; |
| 47 | String text; |
| 48 | if (value instanceof Float) { |
| 49 | text = String.format(Locale.US, "%f", (Float) value); |
| 50 | } else { |
| 51 | text = value.toString(); |
| 52 | } |
| 53 | mWriter.append(text); |
| 54 | } |
| 55 | mWriter.append('\n'); |
| 56 | mWriter.flush(); |
| 57 | } catch (IOException e) { |
| 58 | NLog.e("Failed to write CSV file"); |
| 59 | e.printStackTrace(); |
| 60 | } |
| 61 | } |
| 62 | } |
no test coverage detected