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