[Dive4elements-commits] [PATCH 06 of 12] WaterlevelDifferencesParser: issue1354/1, set timeintervals from waterdiff-csvs

Wald Commits scm-commit at wald.intevation.org
Wed Jun 12 11:51:15 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1371030739 -7200
# Node ID 33ccce4a3aae8d1d0fc60d92d7d42bcf34852dae
# Parent  db7d0600d39df9006155bc16ad9579d2be12217b
WaterlevelDifferencesParser: issue1354/1, set timeintervals from waterdiff-csvs.

diff -r db7d0600d39d -r 33ccce4a3aae backend/src/main/java/org/dive4elements/river/importer/parsers/WaterlevelDifferencesParser.java
--- 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);
             }


More information about the Dive4elements-commits mailing list