Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 948 Rev 949
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles.collection;
2
 
2
 
3
import org.tela_botanica.client.util.UtilString;
3
import org.tela_botanica.client.util.UtilString;
4
 
4
 
5
import com.extjs.gxt.ui.client.data.BaseModelData;
5
import com.extjs.gxt.ui.client.data.BaseModelData;
6
 
6
 
7
public class UniteRangement extends BaseModelData {
7
public class UniteRangement extends BaseModelData {
8
	
8
	
9
	private static final long serialVersionUID = 394843761854792528L;
9
	private static final long serialVersionUID = 394843761854792528L;
10
	public static final String COMPTE_EXACT = "E";
10
	public static final String COMPTE_EXACT = "E";
11
	public static final String COMPTE_APPROXIMATIF = "A";
11
	public static final String COMPTE_APPROXIMATIF = "A";
12
	
12
	
13
	public UniteRangement() {
13
	public UniteRangement() {
14
		
14
		
15
	}
15
	}
16
	
16
	
17
	public UniteRangement(String id, String type, int nombre, String precision, String format) {
17
	public UniteRangement(String id, String type, int nombre, String precision, String format) {
18
		setId(id);
18
		setId(id);
19
		setType(type);
19
		setType(type);
20
		setNombre(nombre);
20
		setNombre(nombre);
21
		setPrecision(precision);
21
		setPrecision(precision);
22
		setFormat(format);
22
		setFormat(format);
23
		setTypeAutre(false);
23
		setTypeAutre(false);
24
	}
24
	}
25
	
25
	
26
	public String getId() {
26
	public String getId() {
27
		return renvoyerValeurCorrecte((String) get("id"));
27
		return renvoyerValeurCorrecte((String) get("id"));
28
	}
28
	}
29
	public void setId(String id) {
29
	public void setId(String id) {
30
		set("id", id);
30
		set("id", id);
31
	}
31
	}
32
	
32
	
33
	public String getType() {
33
	public String getType() {
34
		return renvoyerValeurCorrecte((String) get("type"));
34
		return renvoyerValeurCorrecte((String) get("type"));
35
	}
35
	}
36
	public void setType(String type) {
36
	public void setType(String type) {
37
		set("type", type);
37
		set("type", type);
38
	}
38
	}
39
 
39
 
40
	public double getNombre() {
40
	public double getNombre() {
41
		if (get("nombre") == null) {
41
		if (get("nombre") == null) {
42
			return new Double(0);
42
			return new Double(0);
43
		}
43
		}
44
		return get("nombre");
44
		return get("nombre");
45
	}
45
	}
46
	public void setNombre(double nombre) {
46
	public void setNombre(double nombre) {
47
		set("nombre", nombre);
47
		set("nombre", nombre);
48
	}
48
	}
49
	
49
	
50
	public String getPrecision() {
50
	public String getPrecision() {
51
		return renvoyerValeurCorrecte((String) get("precision"));
51
		return renvoyerValeurCorrecte((String) get("precision"));
52
	}
52
	}
53
	public void setPrecision(String precision) {
53
	public void setPrecision(String precision) {
54
		set("precision", precision);
54
		set("precision", precision);
55
	}
55
	}
56
	
56
	
57
	public String getFormat() {
57
	public String getFormat() {
58
		return renvoyerValeurCorrecte((String) get("format"));
58
		return renvoyerValeurCorrecte((String) get("format"));
59
	}
59
	}
60
	public void setFormat(String format) {
60
	public void setFormat(String format) {
61
		set("format", format);
61
		set("format", format);
62
	}
62
	}
63
	
63
	
64
	public boolean getTypeAutre() {
64
	public boolean getTypeAutre() {
65
		return get("type_autre");
65
		return get("type_autre");
66
	}
66
	}
67
	public void setTypeAutre(boolean bool) {
67
	public void setTypeAutre(boolean bool) {
68
		set("type_autre", bool);
68
		set("type_autre", bool);
69
	}
69
	}
70
	
70
	
71
	private String renvoyerValeurCorrecte(String valeur) {
71
	private String renvoyerValeurCorrecte(String valeur) {
72
		String valeurCorrecte = "";
72
		String valeurCorrecte = "";
73
		if (!UtilString.isEmpty(valeur)) {
73
		if (!UtilString.isEmpty(valeur)) {
74
			valeurCorrecte = valeur;
74
			valeurCorrecte = valeur;
75
		}
75
		}
76
		return valeurCorrecte;
76
		return valeurCorrecte;
77
	}
77
	}
78
}
78
}