Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/importer/parsers/SedimentYieldParser.java @ 5845:1830dae8cb9b
Importer-Parser: set time intevals for complete years when parsing years
author | Tom Gottfried <tom.gottfried@intevation.de> |
---|---|
date | Fri, 26 Apr 2013 08:52:18 +0200 |
parents | 4dd33b86dc61 |
children | 4c3ccf2b0304 |
comparison
equal
deleted
inserted
replaced
5844:4dd33b86dc61 | 5845:1830dae8cb9b |
---|---|
260 if (a.matches()) { | 260 if (a.matches()) { |
261 int yearA = nf.parse(a.group(1)).intValue(); | 261 int yearA = nf.parse(a.group(1)).intValue(); |
262 int yearB = nf.parse(a.group(2)).intValue(); | 262 int yearB = nf.parse(a.group(2)).intValue(); |
263 | 263 |
264 return new ImportTimeInterval( | 264 return new ImportTimeInterval( |
265 getDateFromYear(yearA), | 265 getStartDateFromYear(yearA), |
266 getDateFromYear(yearB) | 266 getEndDateFromYear(yearB) |
267 ); | 267 ); |
268 } | 268 } |
269 | 269 |
270 Matcher b = TIMEINTERVAL_SINGLE.matcher(column); | 270 Matcher b = TIMEINTERVAL_SINGLE.matcher(column); |
271 if (b.matches()) { | 271 if (b.matches()) { |
272 int year = nf.parse(b.group(1)).intValue(); | 272 int year = nf.parse(b.group(1)).intValue(); |
273 | 273 |
274 return new ImportTimeInterval(getDateFromYear(year)); | 274 return new ImportTimeInterval(getStartDateFromYear(year)); |
275 } | 275 } |
276 | 276 |
277 log.warn("SYP: Unknown time interval string: '" + column + "'"); | 277 log.warn("SYP: Unknown time interval string: '" + column + "'"); |
278 } | 278 } |
279 catch (ParseException pe) { | 279 catch (ParseException pe) { |