annotate gnv-artifacts/src/main/java/de/intevation/gnv/exports/ODVExport.java @ 800:db5b04ecb426

ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row. gnv-artifacts/trunk@882 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 06 Apr 2010 13:07:11 +0000
parents d0967fdee36f
children 41a7c49b5cb4
rev   line source
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 package de.intevation.gnv.exports;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
3 import java.util.ArrayList;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
4 import java.util.Collection;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5 import java.util.HashMap;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
6 import java.util.Iterator;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
7 import java.util.Map;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
8
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 import org.apache.log4j.Logger;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10
800
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
11 import au.com.bytecode.opencsv.CSVWriter;
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
12 import de.intevation.gnv.geobackend.base.Result;
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
13 import de.intevation.gnv.state.describedata.KeyValueDescibeData;
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
14 import de.intevation.gnv.state.exception.StateException;
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
15
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16 /**
771
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
17 * This class is used to create a specific export document which is similar to
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
18 * an CSV document.
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 *
771
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
20 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 */
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 public class ODVExport extends DefaultExport {
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23
771
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
24 /**
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
25 * Logger used for logging via log4j.
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
26 */
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
27 private static Logger log = Logger.getLogger(ODVExport.class);
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
28
771
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
29 /**
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
30 * Collection of parameters.
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
31 */
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
32 private Collection parameters = null;
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
33
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34 /**
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35 * Constructor
794
d0967fdee36f Repaired JavaDoc in Export package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 779
diff changeset
36 * @param collector DataCollector used to extract the required data.
d0967fdee36f Repaired JavaDoc in Export package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 779
diff changeset
37 * @param parameters A collection of parameters to be displayed in the
d0967fdee36f Repaired JavaDoc in Export package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 779
diff changeset
38 * export.
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39 */
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
40 public ODVExport(DataCollector collector, Collection parameters) {
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 super(collector);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 this.parameters = parameters;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44
771
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
45 /**
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
46 * @see de.intevation.gnv.exports.Export#writeData(Profile, Collection,
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
47 * CSVWriter)
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
48 */
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
49 @Override
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
50 protected void writeData(Profile profile, Collection result,
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
51 CSVWriter writer) throws StateException {
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
52 Iterator<Result> it = result.iterator();
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 String[] header = profile.getHeader();
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 ArrayList<String> headerList = new ArrayList<String>();
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 for (int i= 0; i < header.length; i++){
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 headerList.add(header[i]);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
58 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59 ArrayList<String> paramids = new ArrayList<String>();
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
60
800
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
61 Map<StringArrayKey, Map<String,String>> aggregatedRows = new HashMap<StringArrayKey, Map<String,String>>();
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
62
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
63 String currentParameterID = "N/N";
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
64
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
65 while (it.hasNext()) {
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 Result res = it.next();
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
67
800
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
68 String[] value = collector.getData(res);
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
69 StringArrayKey key = new StringArrayKey(value);
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
70 String parameterValue = res.getString("DATAVALUE");
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
71 String parameterID = res.getString("PARAMETER");
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
72
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
73 if (!currentParameterID.equals(parameterID)){
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
74 paramids.add(parameterID);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
75 headerList.add(this.findParamTitle(parameters, parameterID));
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
76 headerList.add("QF");
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
77 currentParameterID = parameterID;
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
78 }
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
79
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
80 Map<String,String> aggregatedRow = aggregatedRows.get(key);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
81 if (aggregatedRow!= null){
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
82 aggregatedRow.put(parameterID, parameterValue);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
83 }else{
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
84 Map<String,String> params = new HashMap<String, String>();
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
85 params.put(parameterID, parameterValue);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
86 aggregatedRows.put(key, params);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
87 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
88 }
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
89
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
90 if (header != null){
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
91 writer.writeNext(headerList.toArray(header));
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
92 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
93
800
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
94 Iterator<StringArrayKey> rows = aggregatedRows.keySet().iterator();
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
95 while (rows.hasNext()){
800
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
96 StringArrayKey row = rows.next();
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
97 Map<String,String> params = aggregatedRows.get(row);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
98 ArrayList<String> rowList = new ArrayList<String>();
800
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
99 String[] rowArray = row.getValue();
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
100 for (int i= 0; i < rowArray.length; i++){
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
101 rowList.add(rowArray[i]);
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
102 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
103 for (int i = 0; i < paramids.size();i++){
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
104 String key = paramids.get(i);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
105 String value = params.get(key);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
106 if (value == null){
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
107 value = "";
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
108 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
109 rowList.add(value);
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
110 rowList.add("1");
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
111 }
800
db5b04ecb426 ISSUE215: Improved ODV-Export. now all Columns which have identical values but different Parameters will be merged to one row.
Tim Englich <tim.englich@intevation.de>
parents: 794
diff changeset
112 writer.writeNext(rowList.toArray(rowArray));
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
113 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
114 }
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
115
771
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
116 /**
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
117 * This method is used to search specific value coresponding to its key
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
118 * <code>id</code> and return its description.
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
119 *
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
120 * @param values Collection of parameters.
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
121 * @param id Key used to find the value.
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
122 *
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
123 * @return Description of searched value.
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
124 */
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
125 protected String findParamTitle(Collection values, String id) {
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
126 log.debug("find description of dataset");
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
127
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
128 if (values != null){
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
129 Iterator it = values.iterator();
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
130 while (it.hasNext()) {
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
131 KeyValueDescibeData data = (KeyValueDescibeData) it.next();
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
132
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
133 if (id.equals(data.getKey()))
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
134 return data.getValue();
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
135 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
136 }
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
137 return "";
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
138 }
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 771
diff changeset
139
765
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
140
f28a7eac542a Integrated valid ODV-Export to the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
141 }
771
a0e63136954e Added and repaired javadoc in de.intevation.gnv.exports package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 765
diff changeset
142 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org