annotate gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultFIS.java @ 1115:f953c9a559d8

Added license file and license headers. gnv-artifacts/trunk@1260 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 02 Nov 2010 17:46:55 +0000
parents 05bf8534a35a
children
rev   line source
1115
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
1 /*
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
3 *
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
5 * Read the file LGPL.txt coming with the software for details
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
7 */
f953c9a559d8 Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 836
diff changeset
8
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 package de.intevation.gnv.artifacts.services.requestobjects;
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
11 import java.util.Collection;
606
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
12 import java.util.Iterator;
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
14 /**
792
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
15 * The default implementation of <code>Fis</code>.
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
16 *
780
c4156275c1e1 Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 779
diff changeset
17 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18 *
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 */
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 public class DefaultFIS implements FIS {
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21
826
32d01e1ce2df Added more JavaDocs
Tim Englich <tim.englich@intevation.de>
parents: 803
diff changeset
22 /**
32d01e1ce2df Added more JavaDocs
Tim Englich <tim.englich@intevation.de>
parents: 803
diff changeset
23 * The ID of the FIS
32d01e1ce2df Added more JavaDocs
Tim Englich <tim.englich@intevation.de>
parents: 803
diff changeset
24 */
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 private String id = null;
778
9a828e5a2390 Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 606
diff changeset
26
826
32d01e1ce2df Added more JavaDocs
Tim Englich <tim.englich@intevation.de>
parents: 803
diff changeset
27 /**
32d01e1ce2df Added more JavaDocs
Tim Englich <tim.englich@intevation.de>
parents: 803
diff changeset
28 * The Parameter which belongs to the FIS.
32d01e1ce2df Added more JavaDocs
Tim Englich <tim.englich@intevation.de>
parents: 803
diff changeset
29 */
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
30 private Collection<Parameter> parameter = null;
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
31
792
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
32 /**
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
33 * Constructor
803
feae2f9d6c6f Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 792
diff changeset
34 *
792
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
35 * @param id The id for this fis.
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
36 */
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 public DefaultFIS(String id){
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
38 super();
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39 this.id = id;
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
40 }
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 /**
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 * Constructor
792
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
43 * @param id The id for this fis.
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
44 * @param parameter A collection of parameters.
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45 */
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 public DefaultFIS(String id, Collection<Parameter> parameter) {
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
47 this(id);
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
48 this.parameter = parameter;
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
49 }
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
50
826
32d01e1ce2df Added more JavaDocs
Tim Englich <tim.englich@intevation.de>
parents: 803
diff changeset
51
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
52 public String getID() {
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 return this.id;
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 }
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56 public Collection<Parameter> getParameter() {
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 return this.parameter;
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
58 }
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59
792
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
60 /**
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
61 * Two objects are equal if they have the same id.
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
62 *
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
63 * @param arg0 Object which is checked for equality.
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
64 * @return True, if both objects are equal, otherwise false.
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
65 */
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 @Override
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
67 public boolean equals(Object arg0) {
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
68 boolean returnValue = false;
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69 if (arg0 instanceof FIS){
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
70 returnValue = this.id.equals(((FIS)arg0).getID());
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
71 }
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
72 return returnValue;
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
73 }
792
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
74
606
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
75 /**
792
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
76 * Creates a hash code using the id and the given parameters.
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
77 *
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
78 * @return A hash code.
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
79 */
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
80 @Override
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
81 public int hashCode() {
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
82 int hash = 7;
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
83 hash = 47 * hash + (this.id != null ? this.id.hashCode() : 0);
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
84 hash = 47 * hash + (this.parameter != null ? this.parameter.hashCode() : 0);
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
85 return hash;
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
86 }
826
32d01e1ce2df Added more JavaDocs
Tim Englich <tim.englich@intevation.de>
parents: 803
diff changeset
87
792
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
88 /**
9b9bf42b7928 Added and repaired JavaDoc in artifacts package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 780
diff changeset
89 * @param parameter Collection of parameters.
606
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
90 */
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
91 public void addParameter(Collection<Parameter> parameter) {
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
92 if (this.parameter != null){
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
93 Iterator<Parameter> it = parameter.iterator();
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
94 while (it.hasNext()){
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
95 Parameter tmpParameter = it.next();
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
96 if (!this.parameter.contains(tmpParameter)){
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
97 this.parameter.add(tmpParameter);
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
98 }
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
99 }
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
100 }else{
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
101 this.parameter = parameter;
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
102 }
9efc1c256dbb Added the support of the usecase that one FIS can be identified by different MapServices. In that case the parameters will be merged into the existing FIS.
Tim Englich <tim.englich@intevation.de>
parents: 597
diff changeset
103 }
597
cf38b983d1f3 Added the Implementation of the MetaDataService which will deliver FIS and Parameters that match to Mapservices, Region and Layers that were sent to the Service.
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
104 }
836
05bf8534a35a Using unix line endings only.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 826
diff changeset
105 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org