Subversion Repositories eFlore/Applications.coel

Rev

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