[Dive4elements-commits] [PATCH 10 of 12] Remove code dupe, doc
Wald Commits
scm-commit at wald.intevation.org
Wed Jun 12 11:51:19 CEST 2013
# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1371030214 -7200
# Node ID 1173e9f47b5270732081876be4719ed3e69069a8
# Parent 0647d7f5a275050d903bb5720ef25737796fee98
Remove code dupe, doc.
diff -r 0647d7f5a275 -r 1173e9f47b52 backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java Wed Jun 12 11:27:36 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java Wed Jun 12 11:43:34 2013 +0200
@@ -40,6 +40,7 @@
import org.dive4elements.river.importer.ImportUnit;
import org.dive4elements.river.model.BedHeightType;
import org.dive4elements.river.importer.ImporterSession;
+import org.dive4elements.river.importer.parsers.LineParser;
public abstract class BedHeightParser {
@@ -156,23 +157,6 @@
}
- public static Date getStartDateFromYear(int year) {
- Calendar cal = Calendar.getInstance();
- cal.clear();
- cal.set(year, 0, 1, 0, 0, 0);
-
- return cal.getTime();
- }
-
- public static Date getEndDateFromYear(int year) {
- Calendar cal = Calendar.getInstance();
- cal.clear();
- cal.set(year, 11, 31, 23, 59, 59);
-
- return cal.getTime();
- }
-
-
protected void handleMetaLine(ImportBedHeight obj, String line) {
String meta = stripMetaLine(line);
@@ -243,8 +227,8 @@
int lower = Integer.valueOf(lo);
int upper = Integer.valueOf(up);
- Date fromYear = getStartDateFromYear(lower);
- Date toYear = getEndDateFromYear(upper);
+ Date fromYear = LineParser.getStartDateFromYear(lower);
+ Date toYear = LineParser.getEndDateFromYear(upper);
obj.setTimeInterval(new ImportTimeInterval(fromYear, toYear));
}
diff -r 0647d7f5a275 -r 1173e9f47b52 backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java Wed Jun 12 11:27:36 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java Wed Jun 12 11:43:34 2013 +0200
@@ -147,7 +147,7 @@
}
- /** Create Date on las moment (31st dec) of given year. */
+ /** Create Date on last moment (31st dec) of given year. */
public static Date getEndDateFromYear(int year) {
Calendar cal = Calendar.getInstance();
cal.clear();
More information about the Dive4elements-commits
mailing list