Subversion Repositories eFlore/Applications.cel

Rev

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

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