|
8 | 8 |
|
9 | 9 | public class InducedRefinementsParser { |
10 | 10 |
|
11 | | - private static final String STARTER = |
12 | | - "====================================================== search started:"; |
13 | | - private static final String ENDER = "*************Summary***************"; |
| 11 | + private static final String STARTER = "====================================================== search started:"; |
| 12 | + private static final String ENDER = "*************Summary***************"; |
14 | 13 |
|
15 | | - public InducedRefinementsParser() { |
16 | | - // Does nothing |
17 | | - } |
| 14 | + public InducedRefinementsParser() { |
| 15 | + // Does nothing |
| 16 | + } |
18 | 17 |
|
19 | | - public static List<String> parseRefinements(String file) throws IOException { |
| 18 | + public static List<String> parseRefinements(String file) throws IOException { |
20 | 19 |
|
21 | | - List<String> result = new ArrayList<>(); |
| 20 | + List<String> result = new ArrayList<>(); |
22 | 21 |
|
23 | | - try (BufferedReader reader = new BufferedReader(new FileReader(file))) { |
| 22 | + try (BufferedReader reader = new BufferedReader(new FileReader(file))) { |
24 | 23 |
|
25 | | - String line = reader.readLine(); |
| 24 | + String line = reader.readLine(); |
26 | 25 |
|
27 | | - boolean start = false; |
28 | | - boolean end = false; |
| 26 | + boolean start = false; |
| 27 | + boolean end = false; |
29 | 28 |
|
30 | | - while ((line = reader.readLine()) != null && !end) { |
31 | | - if (!start) { |
32 | | - start = line.startsWith(STARTER); |
33 | | - continue; |
34 | | - } else end = line.startsWith(ENDER); |
| 29 | + while ((line = reader.readLine()) != null && !end) { |
| 30 | + if (!start) { |
| 31 | + start = line.startsWith(STARTER); |
| 32 | + continue; |
| 33 | + } else end = line.startsWith(ENDER); |
35 | 34 |
|
36 | | - if (start && !end) |
37 | | - if (line.contains("NPC constraint")) { |
| 35 | + if (start && !end) |
| 36 | + if (line.contains("NPC constraint")) { |
38 | 37 |
|
39 | | - line = reader.readLine(); |
| 38 | + line = reader.readLine(); |
40 | 39 |
|
41 | | - while (line.endsWith("&&") || line.endsWith("||")) line += reader.readLine(); |
| 40 | + while (line.endsWith("&&") || line.endsWith("||")) line += reader.readLine(); |
42 | 41 |
|
43 | | - if (line.startsWith("%")) line = line.substring(line.indexOf("%", 2) + 1); |
| 42 | + if (line.startsWith("%")) line = line.substring(line.indexOf("%", 2) + 1); |
44 | 43 |
|
45 | | - result.add(line); |
46 | | - } |
47 | | - } |
| 44 | + result.add(line); |
| 45 | + } |
| 46 | + } |
48 | 47 |
|
49 | | - } catch (IOException e) { |
50 | | - e.printStackTrace(); |
51 | | - } |
| 48 | + } catch (IOException e) { |
| 49 | + e.printStackTrace(); |
| 50 | + } |
52 | 51 |
|
53 | | - return result; |
54 | | - } |
| 52 | + return result; |
| 53 | + } |
55 | 54 | } |
0 commit comments