Subversion Repositories eFlore/Applications.coel

Rev

Rev 106 | Rev 363 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 106 Rev 238
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
-
 
2
 
2
 
3
import java.util.Iterator;
3
import java.util.LinkedHashMap;
4
import java.util.LinkedHashMap;
4
 
5
 
5
import com.google.gwt.json.client.JSONArray;
6
import com.google.gwt.json.client.JSONArray;
6
import com.google.gwt.json.client.JSONObject;
7
import com.google.gwt.json.client.JSONObject;
-
 
8
import com.google.gwt.user.client.Window;
7
 
9
 
8
public class PublicationListe extends LinkedHashMap<String, Publication> {
10
public class PublicationListe extends LinkedHashMap<String, Publication> {
9
 
11
 
10
	/**
12
	/**
11
	 * 
13
	 * 
12
	 */
14
	 */
13
	private static final long serialVersionUID = 2600314321196345072L;
15
	private static final long serialVersionUID = 2600314321196345072L;
14
 
16
 
15
	public PublicationListe(int taille)
17
	public PublicationListe(int taille)
16
	{
18
	{
17
		super(taille);
19
		super(taille);
18
	}
20
	}
19
	/**
21
	/**
20
	 * Constructeur pour une liste d'institutions
22
	 * Constructeur pour une liste d'institutions
21
	 * @param dates
23
	 * @param dates
22
	 */
24
	 */
23
	public PublicationListe(JSONArray publications) 
25
	public PublicationListe(JSONObject publications) 
24
	{
26
	{
25
		super(publications.size()) ;
27
		super(publications.size()) ;
26
		final int taillemax = publications.size();
28
		for (Iterator<String> it = publications.keySet().iterator() ; it.hasNext();) {
27
		
-
 
28
		for (int i = 0; i < taillemax; i++) {
-
 
29
			JSONObject publicationCourante = publications.get(i).isObject() ;
29
			JSONObject publicationCourante = publications.get(it.next()).isObject() ;
30
			
-
 
31
			if (publicationCourante != null)	{
30
			if (publicationCourante != null)	{
32
				Publication publication = new Publication(publicationCourante);
31
				Publication publication = new Publication(publicationCourante);
33
				this.put(publication.getId(), publication);
32
				this.put(publication.getId(), publication);
34
			}
33
			}
35
		}
34
		}
36
	}
35
	}
37
	
36
	
38
}
37
}