comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/AtFileParser.java @ 5330:4ccf1175be1c

Cosemtics, doc.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 18 Mar 2013 16:49:04 +0100
parents 976ead36192d
children 95af0f3aabfb
comparison
equal deleted inserted replaced
5329:029b5f5f1dcc 5330:4ccf1175be1c
18 import java.util.Date; 18 import java.util.Date;
19 import java.util.Calendar; 19 import java.util.Calendar;
20 20
21 import de.intevation.flys.importer.ImportTimeInterval; 21 import de.intevation.flys.importer.ImportTimeInterval;
22 22
23 /** Parse *.at (Abflusstafeln?) files. */
23 public class AtFileParser { 24 public class AtFileParser {
24 25
25 public static final String ENCODING = "ISO-8859-1"; 26 public static final String ENCODING = "ISO-8859-1";
26 27
27 private static Logger logger = Logger.getLogger(AtFileParser.class); 28 private static Logger logger = Logger.getLogger(AtFileParser.class);
28
29 29
30 // regular expression from hell to find out time range 30 // regular expression from hell to find out time range
31 public static final Pattern DATE_LINE = Pattern.compile( 31 public static final Pattern DATE_LINE = Pattern.compile(
32 "^\\*\\s*Abflu[^t]+tafel?\\s*([^\\d]+)" + 32 "^\\*\\s*Abflu[^t]+tafel?\\s*([^\\d]+)" +
33 "(\\d{1,2})?\\.?(\\d{1,2})?\\.?(\\d{2,4})\\s*(?:(?:bis)|-)?\\s*" + 33 "(\\d{1,2})?\\.?(\\d{1,2})?\\.?(\\d{2,4})\\s*(?:(?:bis)|-)?\\s*" +
153 153
154 return dischargeTable; 154 return dischargeTable;
155 } 155 }
156 156
157 public static Date guessDate(String day, String month, String year) { 157 public static Date guessDate(String day, String month, String year) {
158 // TODO evaluate whether DateGuesser class can do that.
158 if (day == null && month == null && year == null) { 159 if (day == null && month == null && year == null) {
159 return null; 160 return null;
160 } 161 }
161 162
162 logger.debug("day: " + day + " month: " + month + " year: " + year); 163 logger.debug("day: " + day + " month: " + month + " year: " + year);

http://dive4elements.wald.intevation.org