Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java @ 771:a0e63136954e
Added and repaired javadoc in de.intevation.gnv.exports package.
gnv-artifacts/trunk@827 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 25 Mar 2010 09:01:14 +0000 |
parents | e964a3d8f7bc |
children | 9a828e5a2390 |
comparison
equal
deleted
inserted
replaced
770:d70cac2bafc0 | 771:a0e63136954e |
---|---|
11 | 11 |
12 import de.intevation.gnv.geobackend.base.Result; | 12 import de.intevation.gnv.geobackend.base.Result; |
13 import de.intevation.gnv.state.exception.StateException; | 13 import de.intevation.gnv.state.exception.StateException; |
14 | 14 |
15 /** | 15 /** |
16 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) | 16 * This class is a specialization of {@link ShapeDataCollector} and turns |
17 * furthermore a given datetime string into a specific format. | |
18 * | |
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
17 */ | 20 */ |
18 public class SimpleOdvDataCollector | 21 public class SimpleOdvDataCollector |
19 extends ShapeDataCollector | 22 extends ShapeDataCollector |
20 { | 23 { |
24 /** | |
25 * Logger used for logging with log4j. | |
26 */ | |
21 private static Logger log = Logger.getLogger(SimpleOdvDataCollector.class); | 27 private static Logger log = Logger.getLogger(SimpleOdvDataCollector.class); |
22 | 28 |
29 /** | |
30 * Constant field which defines the source format of a given datetime. | |
31 */ | |
23 public static final String SRC_FORMAT = "yyyy.MM.dd HH:mm:ss"; | 32 public static final String SRC_FORMAT = "yyyy.MM.dd HH:mm:ss"; |
33 | |
34 /** | |
35 * Constant field which defines the target format of a given datetime. | |
36 */ | |
24 public static final String DEST_FORMAT = "yyyy-MM-dd HH:mm"; | 37 public static final String DEST_FORMAT = "yyyy-MM-dd HH:mm"; |
25 | 38 |
39 /** | |
40 * Source format. | |
41 */ | |
26 public static DateFormat srcFormat = new SimpleDateFormat(SRC_FORMAT); | 42 public static DateFormat srcFormat = new SimpleDateFormat(SRC_FORMAT); |
43 | |
44 /** | |
45 * Target format. | |
46 */ | |
27 public static DateFormat destFormat = new SimpleDateFormat(DEST_FORMAT); | 47 public static DateFormat destFormat = new SimpleDateFormat(DEST_FORMAT); |
28 | 48 |
49 /** | |
50 * Constructor | |
51 * | |
52 * @param names See {@link #names} | |
53 */ | |
29 public SimpleOdvDataCollector(String[] names) { | 54 public SimpleOdvDataCollector(String[] names) { |
30 super(names); | 55 super(names); |
31 } | 56 } |
32 | 57 |
58 /** | |
59 * Given datetime values which corresponds to the attribute key 'TIMEVALUE' | |
60 * are transformed from {@link #SRC_FORMAT} into {@link #DEST_FORMAT}. | |
61 * | |
62 * @see de.intevation.gnv.exports.Export.DataCollector#getData(Result) | |
63 */ | |
33 public String[] getData(Result result) | 64 public String[] getData(Result result) |
34 throws StateException | 65 throws StateException |
35 { | 66 { |
36 if (rd == null) | 67 if (rd == null) |
37 init(result); | 68 init(result); |
70 throw new StateException( | 101 throw new StateException( |
71 "Error occured while parsing source data."); | 102 "Error occured while parsing source data."); |
72 } | 103 } |
73 } | 104 } |
74 } | 105 } |
106 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |