annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/SingleInputTransition.java @ 114:d8d38a4dd965

Added TestCase for HorizontalProfiles of InstataneousPoints and the required Configuration gnv-artifacts/trunk@164 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Wed, 30 Sep 2009 13:48:02 +0000
parents bb45c5097cb6
children 7fb9441dd8af
rev   line source
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 /**
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2 *
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
3 */
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
4 package de.intevation.gnv.transition;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
6 import java.util.ArrayList;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
7 import java.util.Collection;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
8
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 import org.apache.log4j.Logger;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
11 import de.intevation.gnv.geobackend.base.Result;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
12 import de.intevation.gnv.transition.describedata.DefaultSingleValueDescribeData;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
14 /**
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
15 * @author Tim Englich <tim.englich@intevation.de>
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16 *
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 */
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18 public class SingleInputTransition extends TransitionBase {
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 /**
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 * the logger, used to log exceptions and additonaly information
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 */
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 private static Logger log = Logger.getLogger(SingleInputTransition.class);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
24
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 /**
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
26 *
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
27 */
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28 private static final long serialVersionUID = -6169497306324917318L;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
30 /**
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
31 * Constructor
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
32 */
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
33 public SingleInputTransition() {
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36 /**
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 * @see de.intevation.gnv.transition.Transition#validate()
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
38 */
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39 public boolean validate() {
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
40 return true;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42
99
bb45c5097cb6 ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
43 /**
bb45c5097cb6 ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
44 * @see de.intevation.gnv.transition.TransitionBase#purifyResult(java.util.Collection, java.lang.String)
bb45c5097cb6 ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
45 */
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 @Override
99
bb45c5097cb6 ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
47 protected void purifyResult(Collection<Result> result, String uuid) {
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
48 log.debug("SingleInputTransition.purifyResult");
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
49 if (this.descibeData == null){
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
50 this.descibeData = new ArrayList<Object>();
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
51 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
52 String value = null;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 if (result != null && result.size() == 1){
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 Result tmpItem = result.iterator().next();
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 value = tmpItem.getObject("MAX").toString();
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 }else{
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 value = "";
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
58 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
60 this.descibeData.add(new DefaultSingleValueDescribeData(this.dataName, value));
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
61 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
62
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
63
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
64 }

http://dive4elements.wald.intevation.org