Subversion Repositories eFlore/Applications.cel

Rev

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

Rev Author Line No. Line
91 jpm 1
package org.tela_botanica.client.modeles;
2
 
3
 
4
import java.util.LinkedHashMap;
5
 
6
import com.google.gwt.json.client.JSONArray;
7
import com.google.gwt.json.client.JSONString;
8
import com.google.gwt.user.client.Window;
9
 
10
/**
11
 * table de hachage composée d'entite geographique, renvoyé par les objets de type DAO
12
 * La clé est le nom de l'entite + le nom de l'entite parente
13
 *
14
 * @author david delon
15
 *
16
 */
17
public class ListeDateObservation extends LinkedHashMap<String, DateObservation> {
18
 
19
	/**
20
	 *
21
	 */
22
	private static final long serialVersionUID = 6057292016502553510L;
23
 
24
	/**
25
	 * Constructeur sans paramètres
26
	 */
27
	public ListeDateObservation()
28
	{
29
		super();
30
	}
31
 
32
	/**
33
	 * Constructeur avec paramètre
34
	 * @param taille la taille de la table de hachage
35
	 */
36
	public ListeDateObservation(int taille)
37
	{
38
		super(taille);
39
	}
40
 
41
	public ListeDateObservation(JSONArray dates)
42
	{
43
		super(dates.size()) ;
44
		final int taillemax = dates.size();
45
 
46
		for (int i = 0; i < taillemax; i++) {
47
 
48
			JSONArray dateEncours = dates.get(i).isArray() ;
49
 
50
			if(dateEncours != null)
51
			{
52
				String dateString = ((JSONString)dateEncours.get(0)).stringValue() ;
53
				DateObservation dat = new DateObservation(dateString);
54
 
55
				this.put(dateString,dat);
56
			}
57
		}
58
	}
59
 
60
}