Subversion Repositories eFlore/Applications.coel

Rev

Rev 277 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 277 Rev 363
Line 1... Line 1...
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
Line 2... Line -...
2
 
-
 
3
import java.util.LinkedHashMap;
-
 
4
 
2
 
5
import com.google.gwt.json.client.JSONArray;
3
import com.google.gwt.json.client.JSONArray;
Line 6... Line 4...
6
import com.google.gwt.json.client.JSONObject;
4
import com.google.gwt.json.client.JSONObject;
7
 
5
 
8
/**
6
/**
9
 * Table de hachage composée d'informations sur les Valeurs des listes, renvoyé par un objet de type DAO
7
 * Table de hachage composée d'informations sur les Valeurs des listes, renvoyé par un objet de type DAO
10
 * La clé est l'id de l'entite.
8
 * La clé est l'id de l'entite.
11
 * 
9
 * 
12
 * @author Grégoire DUCHÉ
10
 * @author Grégoire DUCHÉ
13
 * 
11
 * 
14
 */
-
 
15
public class ProjetListe extends LinkedHashMap<String, Projet> {
-
 
Line -... Line 12...
-
 
12
 */
-
 
13
public class ProjetListe extends aDonneeListe<Projet> {
16
	
14
	
17
	private int id = 0;
15
	private static final long serialVersionUID = -9030260944108896455L;
18
	
16
 
19
	/**
17
	/**
20
	 * Constructeur sans paramètres 
18
	 * Constructeur sans paramètres 
Line 37... Line 35...
37
	 */
35
	 */
38
	public ProjetListe(JSONArray projetsListe) {
36
	public ProjetListe(JSONArray projetsListe) {
39
		super(projetsListe.size());
37
		super(projetsListe.size());
Line 40... Line 38...
40
		
38
		
41
		final int taillemax = projetsListe.size();
-
 
42
		
39
		final int taillemax = projetsListe.size();
43
		for (int i = 0; i < taillemax; i++) {
40
		for (int i = 0; i < taillemax; i++) {
Line 44... Line 41...
44
			JSONObject projetCourant = projetsListe.get(i).isObject() ;
41
			JSONObject projetCourant = projetsListe.get(i).isObject() ;
45
			
42
			
46
			if (projetCourant != null)	{
43
			if (projetCourant != null)	{
47
				Projet projet = new Projet(projetCourant);
44
				Projet projet = new Projet(projetCourant);
48
				this.put(projet.getId(), projet);				
45
				this.put(projet.getId(), projet);				
49
			}
46
			}
50
		}
-
 
51
	}
-
 
52
	
-
 
53
	/**
-
 
54
	 * @param id l'identifiant à définir
-
 
55
	 */
-
 
56
	public void setId(int id) {
-
 
57
		this.id = id;
-
 
58
	}
-
 
59
 
-
 
60
	/**
-
 
61
	 * @return l'identifiant de la liste
-
 
62
	 */
-
 
63
	public Integer getId() {
-
 
64
		return id;
47
		}
65
	}
48
	}