Subversion Repositories eFlore/Applications.coel

Rev

Rev 1513 | Details | Compare with Previous | Last modification | View Log | RSS feed

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