Subversion Repositories eFlore/Applications.coel

Rev

Rev 363 | Rev 935 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 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, renvoyé par un objet de type DAO
8
 * La clé est le nom de l'entite + le nom de l'entite parente
9
 *
10
 * @author david delon
11
 *
12
 */
363 jp_milcent 13
public class StructureListe extends aDonneeListe<Structure> {
60 jpm 14
 
363 jp_milcent 15
	private static final long serialVersionUID = 7384579567038300856L;
69 jpm 16
 
17
	public StructureListe() {
60 jpm 18
		super();
19
	}
20
 
363 jp_milcent 21
	public StructureListe(int taille) {
60 jpm 22
		super(taille);
23
	}
363 jp_milcent 24
 
60 jpm 25
	/**
26
	 * Constructeur pour une liste d'institutions
27
	 * @param dates
28
	 */
363 jp_milcent 29
	public StructureListe(JSONArray structures) {
156 jp_milcent 30
		super(structures.size()) ;
31
		final int taillemax = structures.size();
60 jpm 32
 
33
		for (int i = 0; i < taillemax; i++) {
156 jp_milcent 34
			JSONObject structureCourante = structures.get(i).isObject() ;
60 jpm 35
 
156 jp_milcent 36
			if (structureCourante != null)	{
37
				Structure structure = new Structure(structureCourante);
382 jp_milcent 38
				StructureValorisation valorisation = new StructureValorisation(structureCourante);
39
				structure.setValorisation(valorisation);
40
				StructureConservation conservation = new StructureConservation(structureCourante);
41
				structure.setConservation(conservation);
156 jp_milcent 42
				this.put(structure.getId(), structure);
60 jpm 43
			}
44
		}
45
	}
46
 
47
}