Mercurial > dive4elements > river
changeset 6289:cc11780b3491
Remove code dupe, doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 12 Jun 2013 11:43:34 +0200 |
parents | f40d236098c1 |
children | db7d0600d39d |
files | backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java backend/src/main/java/org/dive4elements/river/importer/parsers/LineParser.java |
diffstat | 2 files changed, 4 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- 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 { @@ -159,23 +160,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); @@ -246,8 +230,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)); }
--- 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();