changeset 6291:33ccce4a3aae

WaterlevelDifferencesParser: issue1354/1, set timeintervals from waterdiff-csvs.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 12 Jun 2013 11:52:19 +0200
parents db7d0600d39d
children f812bd5fe2bf
files backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java	Wed Jun 12 11:51:25 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java	Wed Jun 12 11:52:19 2013 +0200
@@ -20,6 +20,7 @@
 
 import org.apache.log4j.Logger;
 
+import org.dive4elements.river.importer.ImportTimeInterval;
 import org.dive4elements.river.importer.ImportUnit;
 
 import org.dive4elements.river.importer.ImportWst;
@@ -171,9 +172,13 @@
             Matcher m = YEARS_IN_COLUMN.matcher(name);
 
             if (m.matches()) {
-                String startYear = m.group(1);
-                String endYear = m.group(2);
-                // TODO create and set ImportTimeInterval
+                int startYear = Integer.parseInt(m.group(1));
+                int endYear   = Integer.parseInt(m.group(2));
+                ImportTimeInterval time = new ImportTimeInterval(
+                    getStartDateFromYear(startYear),
+                    getEndDateFromYear(endYear)
+                );
+                column.setTimeInterval(time);
             } else {
                 log.debug("No time interval in column header found: " + name);
             }

http://dive4elements.wald.intevation.org