Subversion Repositories eFlore/Applications.coel

Rev

Rev 363 | 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.projet;
147 gduche 2
 
935 jpm 3
import org.tela_botanica.client.modeles.aDonneeListe;
4
 
147 gduche 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 Valeurs des listes, renvoyé par un objet de type DAO
277 jp_milcent 10
 * La clé est l'id de l'entite.
147 gduche 11
 *
277 jp_milcent 12
 * @author Grégoire DUCHÉ
147 gduche 13
 *
14
 */
363 jp_milcent 15
public class ProjetListe extends aDonneeListe<Projet> {
147 gduche 16
 
363 jp_milcent 17
	private static final long serialVersionUID = -9030260944108896455L;
18
 
147 gduche 19
	/**
20
	 * Constructeur sans paramètres
21
	 */
268 jp_milcent 22
	public ProjetListe() {
147 gduche 23
		super();
24
	}
25
 
26
	/**
27
	 * Constructeur avec paramètre
28
	 * @param taille la taille de la table de hachage
29
	 */
268 jp_milcent 30
	public ProjetListe(int taille) {
147 gduche 31
		super(taille);
32
	}
33
 
34
	/**
35
	 * Constructeur pour une liste de projets
36
	 * @param dates
37
	 */
268 jp_milcent 38
	public ProjetListe(JSONArray projetsListe) {
147 gduche 39
		super(projetsListe.size());
40
 
41
		final int taillemax = projetsListe.size();
42
		for (int i = 0; i < taillemax; i++) {
43
			JSONObject projetCourant = projetsListe.get(i).isObject() ;
44
 
45
			if (projetCourant != null)	{
46
				Projet projet = new Projet(projetCourant);
47
				this.put(projet.getId(), projet);
48
			}
49
		}
50
	}
363 jp_milcent 51
}