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