Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/common/UInfoResultType.java @ 9361:2aec052d4088
Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
author | mschaefer |
---|---|
date | Wed, 01 Aug 2018 18:01:11 +0200 |
parents | b3d3c958a594 |
children | bd5f5d2220fa |
rev | line source |
---|---|
8996 | 1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
9328 | 10 package org.dive4elements.river.artifacts.uinfo.common; |
8996 | 11 |
12 import java.text.NumberFormat; | |
13 | |
14 import org.dive4elements.artifacts.CallContext; | |
15 import org.dive4elements.river.artifacts.common.AbstractResultType; | |
16 import org.dive4elements.river.utils.Formatter; | |
17 | |
18 /** | |
19 * @author Domenico Nardi Tironi | |
20 * | |
21 */ | |
22 public abstract class UInfoResultType extends AbstractResultType { | |
23 | |
9006 | 24 private static final long serialVersionUID = 1L; |
25 | |
8996 | 26 public UInfoResultType(final String unit, final String csvHeader) { |
27 super(unit, csvHeader, csvHeader); | |
28 | |
29 } | |
30 | |
31 @Override | |
32 public String exportValue(final CallContext context, final Object value) { | |
33 // TODO Auto-generated method stub | |
34 return null; | |
35 } | |
36 | |
37 @Override | |
38 protected NumberFormat createFormatter(final CallContext context) { | |
39 // TODO Auto-generated method stub | |
40 return null; | |
41 } | |
42 | |
9361
2aec052d4088
Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
mschaefer
parents:
9328
diff
changeset
|
43 public static final UInfoResultType customMultiRowColSalixScenarios = new UInfoResultType(null, "uinfo.export.salix_line.csv.header.scenario") { |
9243 | 44 private static final long serialVersionUID = 1L; |
45 | |
46 @Override | |
47 public String exportValue(final CallContext context, final Object value) { | |
48 throw new UnsupportedOperationException(); | |
49 } | |
50 | |
51 @Override | |
52 protected NumberFormat createFormatter(final CallContext context) { | |
53 throw new UnsupportedOperationException(); | |
54 } | |
55 }; | |
56 | |
9361
2aec052d4088
Refactoring on SalixLineCalculationResult etc., calculation using MQ etc., scenario (regional+supra) csv columns and meta data added
mschaefer
parents:
9328
diff
changeset
|
57 public static final UInfoResultType salix_mw_mnw = new UInfoResultType(null, "uinfo.export.salix_line.csv.header.mw_mnw") { |
9243 | 58 private static final long serialVersionUID = 1L; |
59 | |
60 @Override | |
61 public String exportValue(final CallContext context, final Object value) { | |
62 final double doubleValue = asDouble(value); | |
63 return exportDoubleValue(context, doubleValue); | |
64 } | |
65 | |
66 @Override | |
67 protected NumberFormat createFormatter(final CallContext context) { | |
68 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
69 // digits. | |
70 return Formatter.getSalixLine(context); | |
71 } | |
72 }; | |
73 | |
8996 | 74 public static final UInfoResultType salixline = new UInfoResultType(null, "uinfo.export.salix_line.csv.header.salix_line") { |
9006 | 75 private static final long serialVersionUID = 1L; |
76 | |
8996 | 77 @Override |
78 public String exportValue(final CallContext context, final Object value) { | |
79 final double doubleValue = asDouble(value); | |
80 return exportDoubleValue(context, doubleValue); | |
81 } | |
82 | |
83 @Override | |
84 protected NumberFormat createFormatter(final CallContext context) { | |
85 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
86 // digits. | |
87 return Formatter.getSalixLine(context); | |
88 } | |
89 }; | |
90 | |
9006 | 91 public static final UInfoResultType vegname = new UInfoResultType(null, "uinfo.export.csv.meta.header.veg.name") { |
92 private static final long serialVersionUID = 1L; | |
93 | |
94 @Override | |
95 public String exportValue(final CallContext context, final Object value) { | |
96 return exportStringValue(value); | |
97 } | |
98 | |
99 @Override | |
100 protected NumberFormat createFormatter(final CallContext context) { | |
101 throw new UnsupportedOperationException(); | |
102 } | |
103 }; | |
104 | |
9260 | 105 public static final UInfoResultType vegzone_color = new UInfoResultType(null, "uinfo.export.csv.meta.header.veg.color") { |
106 private static final long serialVersionUID = 1L; | |
107 | |
108 @Override | |
109 public String exportValue(final CallContext context, final Object value) { | |
110 return exportStringValue(value); | |
111 } | |
112 | |
113 @Override | |
114 protected NumberFormat createFormatter(final CallContext context) { | |
115 throw new UnsupportedOperationException(); | |
116 } | |
117 }; | |
9006 | 118 public static final UInfoResultType vegdauervon = new UInfoResultType(null, "uinfo.export.csv.meta.header.veg.dauervon") { |
119 private static final long serialVersionUID = 1L; | |
120 | |
121 @Override | |
122 public String exportValue(final CallContext context, final Object value) { | |
9101 | 123 final double doubleValue = asDouble(value); |
124 return exportDoubleValue(context, doubleValue); | |
9006 | 125 } |
126 | |
127 @Override | |
128 protected NumberFormat createFormatter(final CallContext context) { | |
129 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
130 // digits. | |
131 return Formatter.getUeberflutungsdauer(context); | |
132 } | |
133 }; | |
134 | |
135 public static final UInfoResultType vegdauerbis = new UInfoResultType(null, "uinfo.export.csv.meta.header.veg.dauerbis") { | |
136 private static final long serialVersionUID = 1L; | |
137 | |
138 @Override | |
139 public String exportValue(final CallContext context, final Object value) { | |
9260 | 140 // valix hex-Check? |
141 return String.valueOf(value); | |
9006 | 142 } |
143 | |
144 @Override | |
145 protected NumberFormat createFormatter(final CallContext context) { | |
146 // REMARK: other modules use Formatter.getWaterlevelW(context) instead, but that format with a variable number of | |
147 // digits. | |
148 return Formatter.getUeberflutungsdauer(context); | |
149 } | |
150 }; | |
8996 | 151 } |