Subversion Repositories eFlore/Applications.cel

Rev

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

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