Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 140 Rev 258
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
2
 
2
 
3
 
3
 
4
import java.util.LinkedHashMap;
4
import java.util.LinkedHashMap;
5
 
5
 
6
/**
6
/**
7
 * table de hachage composée d'entite geographique, renvoyé par les objets de type DAO
7
 * table de hachage composée d'entite geographique, renvoyé par les objets de type DAO
8
 * La clé est le nom de l'entite + le nom de l'entite parente
8
 * La clé est le nom de l'entite + le nom de l'entite parente
9
 * 
9
 * 
10
 * @author david delon
10
 * @author david delon
11
 * 
11
 * 
12
 */
12
 */
13
public class ListeEntiteGeographiqueObservation extends LinkedHashMap<String, EntiteGeographiqueObservation> {
13
public class ListeEntiteGeographiqueObservation extends LinkedHashMap<String, EntiteGeographiqueObservation> {
14
	
14
	
15
	private static final long serialVersionUID = 2717710270773281540L;
15
	private static final long serialVersionUID = 2717710270773281540L;
16
	
16
	
17
	/**
17
	/**
18
	 * Constructeur sans paramètres 
18
	 * Constructeur sans paramètres 
19
	 */
19
	 */
20
	public ListeEntiteGeographiqueObservation()
20
	public ListeEntiteGeographiqueObservation()
21
	{
21
	{
22
		super();
22
		super();
23
	}
23
	}
24
	
24
	
25
	/**
25
	/**
26
	 * Constructeur avec paramètre
26
	 * Constructeur avec paramètre
27
	 * @param taille la taille de la table de hachage
27
	 * @param taille la taille de la table de hachage
28
	 */
28
	 */
29
	public ListeEntiteGeographiqueObservation(int taille)
29
	public ListeEntiteGeographiqueObservation(int taille)
30
	{
30
	{
31
		super(taille);
31
		super(taille);
32
	}
32
	}
33
	
33
	
34
	/**
34
	/**
35
	 * Constructeur avec paramètre
35
	 * Constructeur avec paramètre
36
	 * @param ic un tableau d'ImageCarnet 
36
	 * @param ic un tableau d'ImageCarnet 
37
	 */
37
	 */
38
	public ListeEntiteGeographiqueObservation(EntiteGeographiqueObservation[] ent)
38
	public ListeEntiteGeographiqueObservation(EntiteGeographiqueObservation[] ent)
39
	{
39
	{
40
		super() ;
40
		super() ;
41
		for (int i = 0; i < ent.length; i++) 
41
		for (int i = 0; i < ent.length; i++) 
42
		{		
42
		{		
43
			if(ent[i] != null && ent[i] instanceof EntiteGeographiqueObservation)
43
			if(ent[i] != null && ent[i] instanceof EntiteGeographiqueObservation)
44
			{
44
			{
45
				this.put(ent[i].getIdLocation()+ent[i].getLieuDit(),ent[i]);
45
				this.put(ent[i].hashCode()+"",ent[i]);
46
			}
46
			}
47
		}
47
		}
48
	}
48
	}
49
	
49
	
50
	public void put(EntiteGeographiqueObservation value) {
50
	public void put(EntiteGeographiqueObservation value) {
51
		this.put(value.getIdLocation()+value.getLieuDit(),value);
51
		this.put(value.hashCode()+"",value);
52
	}
52
	}
53
		
53
		
54
}
54
}