Subversion Repositories eFlore/Applications.coel

Rev

Rev 64 | Rev 156 | 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 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
 */
69 jpm 15
public class StructureListe extends LinkedHashMap<String, Structure> {
60 jpm 16
 
17
	/**
18
	 * Identifiant pour sérialisé l'objet...
19
	 */
69 jpm 20
	private static final long serialVersionUID = -7165785809164480836L;
21
 
60 jpm 22
	/**
23
	 * Constructeur sans paramètres
24
	 */
69 jpm 25
	public StructureListe() {
60 jpm 26
		super();
27
	}
28
 
29
	/**
30
	 * Constructeur avec paramètre
31
	 * @param taille la taille de la table de hachage
32
	 */
69 jpm 33
	public StructureListe(int taille)
60 jpm 34
	{
35
		super(taille);
36
	}
37
	/**
38
	 * Constructeur pour une liste d'institutions
39
	 * @param dates
40
	 */
69 jpm 41
	public StructureListe(JSONArray institutions)
60 jpm 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
}