Subversion Repositories eFlore/Applications.coel

Rev

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

Rev Author Line No. Line
985 jpm 1
package org.tela_botanica.client.modeles.commentaire;
2
 
3
import org.tela_botanica.client.modeles.aDonneeListe;
4
 
5
import com.google.gwt.json.client.JSONArray;
6
import com.google.gwt.json.client.JSONObject;
7
 
8
public class CommentaireListe extends aDonneeListe<Commentaire> {
9
 
10
	private static final long serialVersionUID = 2600314321196345072L;
11
 
12
	public CommentaireListe() {
13
		super();
14
	}
15
 
16
	public CommentaireListe(int taille) {
17
		super(taille);
18
	}
19
 
20
	/**
21
	 * Constructeur pour une liste de commentaires
22
	 * @param dates
23
	 */
24
	public CommentaireListe(JSONArray commentaires) {
25
		super(commentaires.size());
26
		boolean chargerCollectionACommentaire = true;
27
		int taille = commentaires.size();
28
		for (int i = 0; i < taille; i++) {
29
			JSONObject commentaireCourant = commentaires.get(i).isObject() ;
30
 
31
			if (commentaireCourant != null)	{
32
 
33
				Commentaire commentaire = new Commentaire(commentaireCourant, chargerCollectionACommentaire);
34
				this.put(commentaire.getId(), commentaire);
35
			}
36
		}
37
	}
38
}