Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentDensityParser.java @ 7376:4b26fd60105f
Replaced more tabs with spaces + minor cosmetics (removed out commented code from double precision branch).
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 17 Oct 2013 15:26:12 +0200 |
parents | d3c609581313 |
children | 952b57b43e2f |
comparison
equal
deleted
inserted
replaced
7375:450582bcad75 | 7376:4b26fd60105f |
---|---|
90 | 90 |
91 protected void handleMetaLine(String line) { | 91 protected void handleMetaLine(String line) { |
92 if (handleMetaDepth(line)) { | 92 if (handleMetaDepth(line)) { |
93 return; | 93 return; |
94 } | 94 } |
95 else if (handleMetaYear(line)) { | 95 if (handleMetaYear(line)) { |
96 return; | 96 return; |
97 } | |
98 else { | |
99 log.warn("Unknown meta line: '" + line + "'"); | |
100 } | 97 } |
98 log.warn("Unknown meta line: '" + line + "'"); | |
101 } | 99 } |
102 | 100 |
103 | 101 |
104 protected boolean handleMetaDepth(String line) { | 102 protected boolean handleMetaDepth(String line) { |
105 Matcher m = META_DEPTH.matcher(line); | 103 Matcher m = META_DEPTH.matcher(line); |
137 if (m.matches()) { | 135 if (m.matches()) { |
138 yearString = m.group(1); | 136 yearString = m.group(1); |
139 | 137 |
140 log.info("Found sediment density year: " + yearString); | 138 log.info("Found sediment density year: " + yearString); |
141 | 139 |
142 return true; | 140 return true; |
143 } | 141 } |
144 else { | 142 |
145 log.debug("Meta line doesn't contain year: " + line); | 143 log.debug("Meta line doesn't contain year: " + line); |
146 } | |
147 | 144 |
148 return false; | 145 return false; |
149 } | 146 } |
150 | 147 |
151 | 148 |
175 log.warn("SDP: No km nor density given. Skip line"); | 172 log.warn("SDP: No km nor density given. Skip line"); |
176 return; | 173 return; |
177 } | 174 } |
178 | 175 |
179 BigDecimal year = null; | 176 BigDecimal year = null; |
180 if (yearString != null) { | 177 if (yearString != null) { |
181 try { | 178 try { |
182 year = new BigDecimal(nf.parse(yearString).doubleValue()); | 179 year = new BigDecimal(nf.parse(yearString).doubleValue()); |
183 } | 180 } |
184 catch (ParseException pe) { | 181 catch (ParseException pe) { |
185 log.warn("Unparseable year string"); | 182 log.warn("Unparseable year string"); |
186 } | 183 } |
187 } | 184 } |
188 | 185 |
189 current.addValue(new ImportSedimentDensityValue( | 186 current.addValue(new ImportSedimentDensityValue( |
190 km, | 187 km, |
191 shoreOffset, | 188 shoreOffset, |
192 density, | 189 density, |