1 | package com.medias.database.objects; |
---|
2 | |
---|
3 | // Generated 5 févr. 2007 11:07:11 by Hibernate Tools 3.2.0.b9 |
---|
4 | |
---|
5 | import java.util.Comparator; |
---|
6 | import java.util.HashSet; |
---|
7 | import java.util.Set; |
---|
8 | |
---|
9 | /** |
---|
10 | * Parametre generated by hbm2java |
---|
11 | */ |
---|
12 | public class Parametre |
---|
13 | implements java.io.Serializable |
---|
14 | { |
---|
15 | |
---|
16 | /** |
---|
17 | * |
---|
18 | */ |
---|
19 | private static final long serialVersionUID = 1L; |
---|
20 | |
---|
21 | private int parametreId; |
---|
22 | |
---|
23 | private Unite unite; |
---|
24 | |
---|
25 | private CategorieParam categorieParam; |
---|
26 | |
---|
27 | private Commentaire commentaire; |
---|
28 | |
---|
29 | private String parametreNom; |
---|
30 | |
---|
31 | private String parametreCode; |
---|
32 | |
---|
33 | private Set<Jeu> jeus = new HashSet<Jeu>( 0 ); |
---|
34 | |
---|
35 | private Set<Plateforme> plateformes = new HashSet<Plateforme>( 0 ); |
---|
36 | |
---|
37 | private Set<Bilan> bilans = new HashSet<Bilan>( 0 ); |
---|
38 | |
---|
39 | private Set<Capteur> capteurs = new HashSet<Capteur>( 0 ); |
---|
40 | |
---|
41 | private Set<Valeur> valeurs = new HashSet<Valeur>( 0 ); |
---|
42 | |
---|
43 | private String delta; |
---|
44 | |
---|
45 | private String lod; |
---|
46 | |
---|
47 | public Parametre() |
---|
48 | { |
---|
49 | } |
---|
50 | |
---|
51 | public Parametre( int parametreId, Unite unite, |
---|
52 | CategorieParam categorieParam, String parametreNom, |
---|
53 | String parametreCode ) |
---|
54 | { |
---|
55 | this.parametreId = parametreId; |
---|
56 | this.unite = unite; |
---|
57 | this.categorieParam = categorieParam; |
---|
58 | this.parametreNom = parametreNom; |
---|
59 | this.parametreCode = parametreCode; |
---|
60 | } |
---|
61 | |
---|
62 | public Parametre( int parametreId, Unite unite, |
---|
63 | CategorieParam categorieParam, Commentaire commentaire, |
---|
64 | String parametreNom, String parametreCode, Set<Jeu> jeus, |
---|
65 | Set<Plateforme> plateformes, Set<Bilan> bilans, |
---|
66 | Set<Capteur> capteurs, Set<Valeur> valeurs ) |
---|
67 | { |
---|
68 | this.parametreId = parametreId; |
---|
69 | this.unite = unite; |
---|
70 | this.categorieParam = categorieParam; |
---|
71 | this.commentaire = commentaire; |
---|
72 | this.parametreNom = parametreNom; |
---|
73 | this.parametreCode = parametreCode; |
---|
74 | this.jeus = jeus; |
---|
75 | this.plateformes = plateformes; |
---|
76 | this.bilans = bilans; |
---|
77 | this.capteurs = capteurs; |
---|
78 | this.valeurs = valeurs; |
---|
79 | } |
---|
80 | |
---|
81 | public int getParametreId() |
---|
82 | { |
---|
83 | return this.parametreId; |
---|
84 | } |
---|
85 | |
---|
86 | public void setParametreId( int parametreId ) |
---|
87 | { |
---|
88 | this.parametreId = parametreId; |
---|
89 | } |
---|
90 | |
---|
91 | public Unite getUnite() |
---|
92 | { |
---|
93 | return this.unite; |
---|
94 | } |
---|
95 | |
---|
96 | public void setUnite( Unite unite ) |
---|
97 | { |
---|
98 | this.unite = unite; |
---|
99 | } |
---|
100 | |
---|
101 | public CategorieParam getCategorieParam() |
---|
102 | { |
---|
103 | return this.categorieParam; |
---|
104 | } |
---|
105 | |
---|
106 | public void setCategorieParam( CategorieParam categorieParam ) |
---|
107 | { |
---|
108 | this.categorieParam = categorieParam; |
---|
109 | } |
---|
110 | |
---|
111 | public Commentaire getCommentaire() |
---|
112 | { |
---|
113 | return this.commentaire; |
---|
114 | } |
---|
115 | |
---|
116 | public void setCommentaire( Commentaire commentaire ) |
---|
117 | { |
---|
118 | this.commentaire = commentaire; |
---|
119 | } |
---|
120 | |
---|
121 | public String getParametreNom() |
---|
122 | { |
---|
123 | return this.parametreNom; |
---|
124 | } |
---|
125 | |
---|
126 | public void setParametreNom( String parametreNom ) |
---|
127 | { |
---|
128 | this.parametreNom = parametreNom; |
---|
129 | } |
---|
130 | |
---|
131 | public String getParametreCode() |
---|
132 | { |
---|
133 | return this.parametreCode; |
---|
134 | } |
---|
135 | |
---|
136 | public void setParametreCode( String parametreCode ) |
---|
137 | { |
---|
138 | this.parametreCode = parametreCode; |
---|
139 | } |
---|
140 | |
---|
141 | public Set<Jeu> getJeus() |
---|
142 | { |
---|
143 | return this.jeus; |
---|
144 | } |
---|
145 | |
---|
146 | public void setJeus( Set<Jeu> jeus ) |
---|
147 | { |
---|
148 | this.jeus = jeus; |
---|
149 | } |
---|
150 | |
---|
151 | public Set<Plateforme> getPlateformes() |
---|
152 | { |
---|
153 | return this.plateformes; |
---|
154 | } |
---|
155 | |
---|
156 | public void setPlateformes( Set<Plateforme> plateformes ) |
---|
157 | { |
---|
158 | this.plateformes = plateformes; |
---|
159 | } |
---|
160 | |
---|
161 | public Set<Bilan> getBilans() |
---|
162 | { |
---|
163 | return this.bilans; |
---|
164 | } |
---|
165 | |
---|
166 | public void setBilans( Set<Bilan> bilans ) |
---|
167 | { |
---|
168 | this.bilans = bilans; |
---|
169 | } |
---|
170 | |
---|
171 | public Set<Capteur> getCapteurs() |
---|
172 | { |
---|
173 | return this.capteurs; |
---|
174 | } |
---|
175 | |
---|
176 | public void setCapteurs( Set<Capteur> capteurs ) |
---|
177 | { |
---|
178 | this.capteurs = capteurs; |
---|
179 | } |
---|
180 | |
---|
181 | public Set<Valeur> getValeurs() |
---|
182 | { |
---|
183 | return this.valeurs; |
---|
184 | } |
---|
185 | |
---|
186 | public void setValeurs( Set<Valeur> valeurs ) |
---|
187 | { |
---|
188 | this.valeurs = valeurs; |
---|
189 | } |
---|
190 | |
---|
191 | public String getDelta() { |
---|
192 | return delta; |
---|
193 | } |
---|
194 | |
---|
195 | public void setDelta(String delta) { |
---|
196 | this.delta = delta; |
---|
197 | } |
---|
198 | |
---|
199 | public String getLod() { |
---|
200 | return lod; |
---|
201 | } |
---|
202 | |
---|
203 | public void setLod(String lod) { |
---|
204 | this.lod = lod; |
---|
205 | } |
---|
206 | |
---|
207 | public String getParametreDescription() |
---|
208 | { |
---|
209 | if( commentaire == null ) |
---|
210 | { |
---|
211 | return ""; |
---|
212 | } |
---|
213 | else |
---|
214 | { |
---|
215 | return commentaire.getCommentaireTxt(); |
---|
216 | } |
---|
217 | } |
---|
218 | |
---|
219 | /** |
---|
220 | * We need this equals to display only one Parameter and the others with the same name in submenus |
---|
221 | * example : "Particle Concentration" |
---|
222 | * |
---|
223 | * @param o |
---|
224 | * @return |
---|
225 | */ |
---|
226 | @Override |
---|
227 | public boolean equals( final Object o ) |
---|
228 | { |
---|
229 | if( this == o ) return true; |
---|
230 | if( o == null || getClass() != o.getClass() ) return false; |
---|
231 | |
---|
232 | final Parametre parametre = (Parametre) o; |
---|
233 | |
---|
234 | if( parametreNom != null ? !parametreNom.equals( parametre.parametreNom ) : parametre.parametreNom != null ) return false; |
---|
235 | |
---|
236 | return true; |
---|
237 | } |
---|
238 | |
---|
239 | public class ComparatorNom |
---|
240 | implements Comparator<Parametre> |
---|
241 | { |
---|
242 | public int compare( Parametre p1, Parametre p2 ) |
---|
243 | { |
---|
244 | return p1.getParametreNom().compareTo( p2.getParametreNom() ); |
---|
245 | } |
---|
246 | } |
---|
247 | |
---|
248 | public class ComparatorNomId |
---|
249 | implements Comparator<Parametre> |
---|
250 | { |
---|
251 | public int compare( Parametre p1, Parametre p2 ) |
---|
252 | { |
---|
253 | int compareNom = p1.getParametreNom().compareTo( p2.getParametreNom() ); |
---|
254 | if( compareNom == 0 ) |
---|
255 | return new Integer( p1.getParametreId() ).compareTo( new Integer( p2.getParametreId() ) ); |
---|
256 | else |
---|
257 | return compareNom; |
---|
258 | } |
---|
259 | } |
---|
260 | } |
---|