(String fileName)
| 130 | class FileInputSupplier implements Supplier<Input> { |
| 131 | private Iterator<String> input; |
| 132 | FileInputSupplier(String fileName) { |
| 133 | try { |
| 134 | input = Files.lines(Paths.get(fileName)) |
| 135 | .skip(1) // Skip the comment line |
| 136 | .flatMap(s -> Arrays.stream(s.split(";"))) |
| 137 | .map(String::trim) |
| 138 | .collect(Collectors.toList()) |
| 139 | .iterator(); |
| 140 | } catch(IOException e) { |
| 141 | throw new RuntimeException(e); |
| 142 | } |
| 143 | } |
| 144 | @Override public Input get() { |
| 145 | if(!input.hasNext()) |
| 146 | return null; |