Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultFIS.java @ 792:9b9bf42b7928
Added and repaired JavaDoc in artifacts package.
gnv-artifacts/trunk@874 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 31 Mar 2010 10:52:34 +0000 |
parents | c4156275c1e1 |
children | feae2f9d6c6f |
comparison
equal
deleted
inserted
replaced
791:23877dd69444 | 792:9b9bf42b7928 |
---|---|
2 | 2 |
3 import java.util.Collection; | 3 import java.util.Collection; |
4 import java.util.Iterator; | 4 import java.util.Iterator; |
5 | 5 |
6 /** | 6 /** |
7 * The default implementation of <code>Fis</code>. | |
8 * | |
7 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> | 9 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
8 * | 10 * |
9 */ | 11 */ |
10 public class DefaultFIS implements FIS { | 12 public class DefaultFIS implements FIS { |
11 | 13 |
12 | 14 |
13 private String id = null; | 15 private String id = null; |
14 | 16 |
15 private Collection<Parameter> parameter = null; | 17 private Collection<Parameter> parameter = null; |
16 | 18 |
19 /** | |
20 * Constructor | |
21 * | |
22 * @param id The id for this fis. | |
23 */ | |
17 public DefaultFIS(String id){ | 24 public DefaultFIS(String id){ |
18 super(); | 25 super(); |
19 this.id = id; | 26 this.id = id; |
20 } | 27 } |
21 /** | 28 /** |
22 * Constructor | 29 * Constructor |
23 * @param id | 30 * @param id The id for this fis. |
24 * @param parameter | 31 * @param parameter A collection of parameters. |
25 */ | 32 */ |
26 public DefaultFIS(String id, Collection<Parameter> parameter) { | 33 public DefaultFIS(String id, Collection<Parameter> parameter) { |
27 this(id); | 34 this(id); |
28 this.parameter = parameter; | 35 this.parameter = parameter; |
29 } | 36 } |
30 | 37 |
31 /** | 38 /** |
32 * @see de.intevation.gnv.artifacts.services.requestobjects.FIS#getID() | 39 * @return the id. |
33 */ | 40 */ |
34 public String getID() { | 41 public String getID() { |
35 return this.id; | 42 return this.id; |
36 } | 43 } |
37 | 44 |
38 /** | 45 /** |
39 * @see de.intevation.gnv.artifacts.services.requestobjects.FIS#getParameter() | 46 * @return the parameter collection. |
40 */ | 47 */ |
41 public Collection<Parameter> getParameter() { | 48 public Collection<Parameter> getParameter() { |
42 return this.parameter; | 49 return this.parameter; |
43 } | 50 } |
44 | 51 |
52 /** | |
53 * Two objects are equal if they have the same id. | |
54 * | |
55 * @param arg0 Object which is checked for equality. | |
56 * @return True, if both objects are equal, otherwise false. | |
57 */ | |
45 @Override | 58 @Override |
46 public boolean equals(Object arg0) { | 59 public boolean equals(Object arg0) { |
47 boolean returnValue = false; | 60 boolean returnValue = false; |
48 if (arg0 instanceof FIS){ | 61 if (arg0 instanceof FIS){ |
49 returnValue = this.id.equals(((FIS)arg0).getID()); | 62 returnValue = this.id.equals(((FIS)arg0).getID()); |
50 } | 63 } |
51 return returnValue; | 64 return returnValue; |
52 } | 65 } |
66 | |
53 /** | 67 /** |
54 * @see de.intevation.gnv.artifacts.services.requestobjects.FIS#addParameter(java.util.Collection) | 68 * Creates a hash code using the id and the given parameters. |
69 * | |
70 * @return A hash code. | |
71 */ | |
72 @Override | |
73 public int hashCode() { | |
74 int hash = 7; | |
75 hash = 47 * hash + (this.id != null ? this.id.hashCode() : 0); | |
76 hash = 47 * hash + (this.parameter != null ? this.parameter.hashCode() : 0); | |
77 return hash; | |
78 } | |
79 /** | |
80 * @param parameter Collection of parameters. | |
55 */ | 81 */ |
56 public void addParameter(Collection<Parameter> parameter) { | 82 public void addParameter(Collection<Parameter> parameter) { |
57 if (this.parameter != null){ | 83 if (this.parameter != null){ |
58 Iterator<Parameter> it = parameter.iterator(); | 84 Iterator<Parameter> it = parameter.iterator(); |
59 while (it.hasNext()){ | 85 while (it.hasNext()){ |
68 } | 94 } |
69 | 95 |
70 | 96 |
71 | 97 |
72 } | 98 } |
99 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |