Subversion Repositories eFlore/Applications.coel

Rev

Rev 64 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
package org.tela_botanica.client.modeles;
2
 
3
import java.util.LinkedHashMap;
4
 
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
 */
15
public class ListeStructure extends LinkedHashMap<String, Structure> {
16
 
17
	/**
18
	 * Identifiant pour sérialisé l'objet...
19
	 */
20
	private static final long serialVersionUID = 2L;
21
 
22
	/**
23
	 * Constructeur sans paramètres
24
	 */
25
	public ListeStructure() {
26
		super();
27
	}
28
 
29
	/**
30
	 * Constructeur avec paramètre
31
	 * @param taille la taille de la table de hachage
32
	 */
33
	public ListeStructure(int taille)
34
	{
35
		super(taille);
36
	}
37
	/**
38
	 * Constructeur pour une liste d'institutions
39
	 * @param dates
40
	 */
41
	public ListeStructure(JSONArray institutions)
42
	{
43
		super(institutions.size()) ;
44
		final int taillemax = institutions.size();
45
 
46
		for (int i = 0; i < taillemax; i++) {
47
			JSONObject institutionCourante = institutions.get(i).isObject() ;
48
 
49
			if (institutionCourante != null)	{
50
				Structure institution = new Structure(institutionCourante);
51
				this.put(institution.getId(), institution);
52
			}
53
		}
54
	}
55
 
56
}