Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/parsers/MorphologicalWidthParser.java @ 8991:c43d8c1a4455
Parse via decimalformat instead of bigdecimal constructor (to cope with strings with chars after the actual number)
author | mschaefer |
---|---|
date | Tue, 10 Apr 2018 16:43:32 +0200 |
parents | 2693bfaf503d |
children |
comparison
equal
deleted
inserted
replaced
8990:07dcedddf839 | 8991:c43d8c1a4455 |
---|---|
8 | 8 |
9 package org.dive4elements.river.importer.parsers; | 9 package org.dive4elements.river.importer.parsers; |
10 | 10 |
11 import java.math.BigDecimal; | 11 import java.math.BigDecimal; |
12 import java.text.NumberFormat; | 12 import java.text.NumberFormat; |
13 import java.text.ParseException; | |
13 import java.util.ArrayList; | 14 import java.util.ArrayList; |
14 import java.util.List; | 15 import java.util.List; |
15 import java.util.regex.Matcher; | 16 import java.util.regex.Matcher; |
16 import java.util.regex.Pattern; | 17 import java.util.regex.Pattern; |
17 | 18 |
111 km, | 112 km, |
112 width, | 113 width, |
113 desc | 114 desc |
114 )); | 115 )); |
115 } | 116 } |
116 catch (final NumberFormatException pe) { | 117 catch (final ParseException pe) { |
117 log.warn("MWP: unparseable number in data row: " + line); | 118 log.warn("MWP: unparseable number in data row: " + line); |
118 } | 119 } |
119 } | 120 } |
120 | 121 |
121 | 122 |