Mercurial > dive4elements > river
annotate backend/src/main/java/org/dive4elements/river/importer/parsers/NameAndTimeInterval.java @ 8031:6954ac9b7591
Renamed ImportSedimentYield to ImportSedimentLoadLS.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 11 Jul 2014 13:10:05 +0200 |
parents | 9231940bd192 |
children | 3bb1c62ad732 |
rev | line source |
---|---|
6328
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 * |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 */ |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 package org.dive4elements.river.importer.parsers; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
10 import java.util.ArrayList; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
11 import java.util.Date; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
12 import java.util.List; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
13 import java.util.regex.Pattern; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
14 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 import org.apache.log4j.Logger; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
16 import org.dive4elements.river.importer.ImportTimeInterval; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
17 import org.dive4elements.river.utils.DateGuesser; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
18 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
19 public class NameAndTimeInterval { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
20 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
21 private static Logger log = Logger.getLogger(NameAndTimeInterval.class); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
22 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
23 // TODO: To be extented. |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
24 private static final Pattern MAIN_VALUE = Pattern.compile( |
6334
9231940bd192
Backend: Extended list of recognized main value names in STA/official line classification
Sascha L. Teichmann <teichmann@intevation.de>
parents:
6328
diff
changeset
|
25 "^(HQ|HSQ|MHW|GLQ|NMQ|HQEXT)(\\d*)$"); |
6328
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
26 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
27 private String name; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
28 private ImportTimeInterval timeInterval; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
29 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
30 public NameAndTimeInterval() { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
31 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
32 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
33 public NameAndTimeInterval(String name) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
34 this(name, null); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
35 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
36 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
37 public NameAndTimeInterval(String name, ImportTimeInterval timeInterval) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
38 this.name = name; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
39 this.timeInterval = timeInterval; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
40 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
41 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
42 public String getName() { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
43 return name; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
44 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
45 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
46 public ImportTimeInterval getTimeInterval() { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
47 return timeInterval; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
48 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
49 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
50 @Override |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
51 public String toString() { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
52 return "name: " + name + " time interval: " + timeInterval; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
53 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
54 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
55 public static boolean isMainValue(String s) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
56 s = s.replace(" ", "").toUpperCase(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
57 return MAIN_VALUE.matcher(s).matches(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
58 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
59 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
60 public static NameAndTimeInterval parseName(String name) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
61 List<String> result = new ArrayList<String>(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
62 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
63 unbracket(name, 0, result); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
64 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
65 int length = result.size(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
66 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
67 if (length < 1) { // Should not happen. |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
68 return new NameAndTimeInterval(name); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
69 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
70 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
71 if (length == 1) { // No date at all -> use first part. |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
72 return new NameAndTimeInterval(result.get(0).trim()); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
73 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
74 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
75 if (length == 2) { // e.g. HQ(1994) or HQ(1994 - 1999) |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
76 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
77 String type = result.get(0).trim(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
78 ImportTimeInterval timeInterval = null; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
79 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
80 String datePart = result.get(1).trim(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
81 if (isMainValue(datePart)) { // e.g. W(HQ100) |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
82 type += "(" + datePart + ")"; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
83 timeInterval = null; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
84 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
85 else { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
86 timeInterval = getTimeInterval(result.get(1).trim()); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
87 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
88 if (timeInterval == null) { // No date at all. |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
89 type = name; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
90 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
91 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
92 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
93 return new NameAndTimeInterval(type, timeInterval); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
94 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
95 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
96 if (length == 3) { // e.g W(Q(1994)) or W(Q(1994 - 1999)) |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
97 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
98 String type = |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
99 result.get(0).trim() + "(" + |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
100 result.get(1).trim() + ")"; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
101 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
102 ImportTimeInterval timeInterval = getTimeInterval( |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
103 result.get(2).trim()); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
104 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
105 if (timeInterval == null) { // No date at all. |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
106 type = name; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
107 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
108 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
109 return new NameAndTimeInterval(type, timeInterval); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
110 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
111 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
112 // more than 3 elements return unmodified. |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
113 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
114 return new NameAndTimeInterval(name); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
115 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
116 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
117 private static ImportTimeInterval getTimeInterval(String datePart) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
118 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
119 int minus = datePart.indexOf('-'); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
120 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
121 if (minus < 0) { // '-' not found |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
122 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
123 Date date = null; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
124 try { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
125 date = DateGuesser.guessDate(datePart); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
126 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
127 catch (IllegalArgumentException iae) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
128 log.warn("STA: Invalid date '" + datePart + "'"); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
129 return null; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
130 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
131 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
132 return new ImportTimeInterval(date); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
133 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
134 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
135 // Found '-' so we have <from> - <to> |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
136 String startPart = datePart.substring(0, minus).trim(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
137 String endPart = datePart.substring(minus).trim(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
138 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
139 Date startDate = null; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
140 Date endDate = null; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
141 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
142 try { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
143 startDate = DateGuesser.guessDate(startPart); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
144 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
145 catch (IllegalArgumentException iae) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
146 log.warn("STA: Invalid start date '" + startPart + "'"); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
147 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
148 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
149 try { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
150 endDate = DateGuesser.guessDate(endPart); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
151 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
152 catch (IllegalArgumentException iae) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
153 log.warn("STA: Invalid end date '" + endPart + "'"); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
154 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
155 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
156 if (startDate == null) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
157 log.warn("STA: Need start date."); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
158 return null; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
159 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
160 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
161 return new ImportTimeInterval(startDate, endDate); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
162 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
163 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
164 private static int unbracket(String s, int index, List<String> result) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
165 StringBuilder sb = new StringBuilder(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
166 int length = s.length(); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
167 while (index < length) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
168 char c = s.charAt(index); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
169 switch (c) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
170 case '(': |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
171 index = unbracket(s, index+1, result); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
172 break; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
173 case ')': |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
174 result.add(0, sb.toString()); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
175 return index+1; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
176 default: |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
177 sb.append(c); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
178 ++index; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
179 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
180 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
181 result.add(0, sb.toString()); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
182 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
183 return index; |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
184 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
185 |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
186 /* |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
187 public static void main(String [] args) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
188 for (String arg: args) { |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
189 NameAndTimeInterval nti = parseName(arg); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
190 System.out.println(arg + " -> " + nti); |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
191 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
192 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
193 */ |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
194 } |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
195 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |
53d08f33d094
Backend: Moved guessing of main values and there time intervals out of the STA parser. Same come will be useful to extend the WST parser to better handle official lines.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
196 |