Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/importer/parsers/W80Parser.java @ 4762:c6654a19b00f
W80Parser: Use DateGuesser to set a date.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 04 Jan 2013 11:12:28 +0100 |
parents | ab87408bb0d3 |
children | 99f9e371371b |
comparison
equal
deleted
inserted
replaced
4761:ab87408bb0d3 | 4762:c6654a19b00f |
---|---|
4 | 4 |
5 import de.intevation.flys.importer.XY; | 5 import de.intevation.flys.importer.XY; |
6 | 6 |
7 import de.intevation.flys.utils.EpsilonComparator; | 7 import de.intevation.flys.utils.EpsilonComparator; |
8 import de.intevation.flys.importer.parsers.tim.Coordinate; | 8 import de.intevation.flys.importer.parsers.tim.Coordinate; |
9 | |
10 import de.intevation.flys.utils.DateGuesser; | |
9 | 11 |
10 import java.io.File; | 12 import java.io.File; |
11 import java.io.IOException; | 13 import java.io.IOException; |
12 | 14 |
13 import java.util.ArrayList; | 15 import java.util.ArrayList; |
79 | 81 |
80 | 82 |
81 /** Get the year of this cross sections measurement. */ | 83 /** Get the year of this cross sections measurement. */ |
82 @Override | 84 @Override |
83 public Integer getYear() { | 85 public Integer getYear() { |
84 return null; | 86 Calendar dateCalendar = Calendar.getInstance(); |
87 dateCalendar.setTime(anchorDate); | |
88 return dateCalendar.get(Calendar.YEAR); | |
85 } | 89 } |
86 | 90 |
87 | 91 |
88 /** | 92 /** |
89 * Return the data parsed. | 93 * Return the data parsed. |
219 if (anchor == null || anchor.getStation() != stationKm) { | 223 if (anchor == null || anchor.getStation() != stationKm) { |
220 this.anchor = new Anchor(new Coordinate(gkRightKm, gkHighKm, heightM), stationKm); | 224 this.anchor = new Anchor(new Coordinate(gkRightKm, gkHighKm, heightM), stationKm); |
221 currentLine = new ArrayList<XY>(); | 225 currentLine = new ArrayList<XY>(); |
222 data.put(stationKm, currentLine); | 226 data.put(stationKm, currentLine); |
223 currentLine.add(new XY(0d, heightM,0)); | 227 currentLine.add(new XY(0d, heightM,0)); |
228 anchorDate = DateGuesser.guessDate(date); | |
224 } | 229 } |
225 else { | 230 else { |
226 addPoint(gkRightKm, gkHighKm, heightM, pointIndex); | 231 addPoint(gkRightKm, gkHighKm, heightM, pointIndex); |
227 } | 232 } |
228 } | 233 } |