208 |
jp_milcent |
1 |
package org.tela_botanica.client.modeles;
|
|
|
2 |
|
|
|
3 |
import com.google.gwt.json.client.JSONArray;
|
|
|
4 |
import com.google.gwt.json.client.JSONObject;
|
|
|
5 |
|
|
|
6 |
/**
|
|
|
7 |
* Table de hachage composée d'informations sur les Structures et les Personnes, renvoyé par un objet de type DAO
|
|
|
8 |
* La clé est une concaténation des clés primaires de la table coel_structure_a_personne séparées par un tiret "-".
|
|
|
9 |
*
|
|
|
10 |
* @author david delon
|
|
|
11 |
*
|
|
|
12 |
*/
|
740 |
jpm |
13 |
public class StructureAPersonneListe extends aDonneeListe<StructureAPersonne> {
|
208 |
jp_milcent |
14 |
|
740 |
jpm |
15 |
private static final long serialVersionUID = -2000442795474013672L;
|
|
|
16 |
|
208 |
jp_milcent |
17 |
public StructureAPersonneListe() {
|
|
|
18 |
super();
|
|
|
19 |
}
|
|
|
20 |
|
740 |
jpm |
21 |
public StructureAPersonneListe(int taille) {
|
208 |
jp_milcent |
22 |
super(taille);
|
|
|
23 |
}
|
740 |
jpm |
24 |
|
|
|
25 |
public StructureAPersonneListe(JSONArray structures) {
|
208 |
jp_milcent |
26 |
super(structures.size()) ;
|
|
|
27 |
final int taillemax = structures.size();
|
|
|
28 |
|
|
|
29 |
for (int i = 0; i < taillemax; i++) {
|
|
|
30 |
JSONObject structureAPersonneCourante = structures.get(i).isObject() ;
|
|
|
31 |
|
|
|
32 |
if (structureAPersonneCourante != null) {
|
|
|
33 |
StructureAPersonne structureAPersonne = new StructureAPersonne(structureAPersonneCourante);
|
|
|
34 |
this.put(structureAPersonne.getId(), structureAPersonne);
|
|
|
35 |
}
|
|
|
36 |
}
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
}
|