Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 9d2e69f971f5 |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
50 super(msg); | 50 super(msg); |
51 } | 51 } |
52 } // class LineParserException | 52 } // class LineParserException |
53 | 53 |
54 | 54 |
55 protected abstract void handleLine(int lineNum, String line) throws LineParserException; | 55 protected abstract void handleLine(int lineNum, String line) |
56 throws LineParserException; | |
56 | 57 |
57 protected abstract void reset(); | 58 protected abstract void reset(); |
58 | 59 |
59 protected abstract void finish(); | 60 protected abstract void finish(); |
60 | 61 |
64 protected File inputFile; | 65 protected File inputFile; |
65 | 66 |
66 | 67 |
67 /** | 68 /** |
68 * This method reads each line of <i>file</i>. At the beginning, | 69 * This method reads each line of <i>file</i>. At the beginning, |
69 * <i>reset()</i> is called; afterwards for each line <i>handleLine()</i> is | 70 * <i>reset()</i> is called; |
71 * afterwards for each line <i>handleLine()</i> is | |
70 * called; at the end <i>finish</i> is called. | 72 * called; at the end <i>finish</i> is called. |
71 * | 73 * |
72 * @param file The file which should be parsed. | 74 * @param file The file which should be parsed. |
73 */ | 75 */ |
74 public void parse(File file) throws IOException { | 76 public void parse(File file) throws IOException { |
125 | 127 |
126 // meta-lines often have trailing semicolons in real data | 128 // meta-lines often have trailing semicolons in real data |
127 return tmp.replaceAll(SEPERATOR_CHAR + "*$", "").trim(); | 129 return tmp.replaceAll(SEPERATOR_CHAR + "*$", "").trim(); |
128 } | 130 } |
129 | 131 |
130 public static double getDouble(String doubleString) throws ParseException { | 132 public static double getDouble(String doubleString) |
133 throws ParseException { | |
131 NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE); | 134 NumberFormat nf = NumberFormat.getInstance(DEFAULT_LOCALE); |
132 Number value = nf.parse(doubleString); | 135 Number value = nf.parse(doubleString); |
133 | 136 |
134 return value.doubleValue(); | 137 return value.doubleValue(); |
135 } | 138 } |