Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/SingleInputState.java @ 376:d8f3ef441bf2
merged gnv-artifacts/0.3
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:13:47 +0200 |
parents | e964a3d8f7bc |
children | b7bb66440cc8 |
comparison
equal
deleted
inserted
replaced
293:6b0ef2324d02 | 376:d8f3ef441bf2 |
---|---|
1 /** | |
2 * | |
3 */ | |
4 package de.intevation.gnv.state; | |
5 | |
6 import java.util.ArrayList; | |
7 import java.util.Collection; | |
8 | |
9 import org.apache.log4j.Logger; | |
10 | |
11 import de.intevation.gnv.geobackend.base.Result; | |
12 import de.intevation.gnv.state.describedata.DefaultSingleValueDescribeData; | |
13 | |
14 /** | |
15 * @author Tim Englich <tim.englich@intevation.de> | |
16 * | |
17 */ | |
18 public class SingleInputState extends StateBase { | |
19 | |
20 /** | |
21 * the logger, used to log exceptions and additonaly information | |
22 */ | |
23 private static Logger log = Logger.getLogger(SingleInputState.class); | |
24 | |
25 /** | |
26 * | |
27 */ | |
28 private static final long serialVersionUID = -6169497306324917318L; | |
29 | |
30 /** | |
31 * Constructor | |
32 */ | |
33 public SingleInputState() { | |
34 } | |
35 | |
36 /** | |
37 * @see de.intevation.gnv.state.StateBase#purifyResult(java.util.Collection, | |
38 * java.lang.String) | |
39 */ | |
40 @Override | |
41 protected void purifyResult(Collection<Result> result, String uuid) { | |
42 log.debug("SingleInputState.purifyResult"); | |
43 Collection<Object> describeData = this.getDescibeData(uuid); | |
44 if (describeData == null) { | |
45 describeData = new ArrayList<Object>(); | |
46 } | |
47 String value = null; | |
48 if (result != null && result.size() == 1) { | |
49 Result tmpItem = result.iterator().next(); | |
50 value = tmpItem.getObject("MAX").toString(); | |
51 } else { | |
52 value = ""; | |
53 } | |
54 | |
55 describeData.add(new DefaultSingleValueDescribeData(this.dataName,value)); | |
56 this.setDescibeData(uuid, describeData); | |
57 } | |
58 | |
59 } |