Subversion Repositories eFlore/Applications.del

Rev

Rev 230 | Rev 335 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9 benjamin 1
package org.tela_botanica.del.client.cache;
2
 
147 benjamin 3
import java.util.List;
4
 
5
import org.tela_botanica.del.client.modeles.Image;
9 benjamin 6
import org.tela_botanica.del.client.modeles.Observation;
178 benjamin 7
import org.tela_botanica.del.client.modeles.Protocole;
9 benjamin 8
 
14 benjamin 9
public class CacheClient {
9 benjamin 10
 
230 gduche 11
	private Observation observationCourante;
147 benjamin 12
	private Image imageCourante;
73 benjamin 13
	private String taxonPourRechercheEflore;
178 benjamin 14
	private Protocole protocoleCourant;
147 benjamin 15
	private List<Image> images;
16
	private int numPageRechercheImage = 0;
263 gduche 17
	private int paginationPasRechercheImage = 10;
14 benjamin 18
	private static CacheClient instance;
9 benjamin 19
 
14 benjamin 20
	private CacheClient() {
9 benjamin 21
		instance = this;
22
	}
23
 
230 gduche 24
	public Observation getObservationCourante() {
25
		return observationCourante;
9 benjamin 26
	}
27
 
230 gduche 28
	public void setObservationCourante(Observation observationCourante) {
29
		this.observationCourante = observationCourante;
9 benjamin 30
	}
31
 
14 benjamin 32
	public static CacheClient getInstance() {
9 benjamin 33
		if (instance == null) {
14 benjamin 34
			instance = new CacheClient();
9 benjamin 35
		}
36
		return instance;
37
	}
38
 
73 benjamin 39
	public String getTaxonPourRechercheEflore() {
40
		return taxonPourRechercheEflore;
41
	}
42
 
43
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
44
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
45
	}
46
 
147 benjamin 47
	public int getNumPageRechercheImage() {
48
		return numPageRechercheImage;
49
	}
50
 
51
	public void setNumPageRechercheImage(int numPageRechercheImage) {
52
		this.numPageRechercheImage = numPageRechercheImage;
53
	}
54
 
263 gduche 55
	public int getPaginationPasRechercheImage() {
56
		return paginationPasRechercheImage;
147 benjamin 57
	}
58
 
263 gduche 59
	public void setPaginationPasRerchercheImage(int paginationPas) {
60
		this.paginationPasRechercheImage = paginationPas;
147 benjamin 61
	}
62
 
63
	public List<Image> getImages() {
64
		return images;
65
	}
230 gduche 66
 
224 aurelien 67
	public List<Image> getSousListeImages(int premiere, int derniere) {
230 gduche 68
		if (derniere > images.size() - 1) {
226 aurelien 69
			derniere = images.size() - 1;
70
		}
224 aurelien 71
		return images.subList(premiere, derniere);
72
	}
147 benjamin 73
 
74
	public void setImages(List<Image> images) {
75
		this.images = images;
76
	}
77
 
78
	public Image getImageCourante() {
79
		return imageCourante;
80
	}
81
 
82
	public void setImageCourante(Image imageCourante) {
83
		this.imageCourante = imageCourante;
84
	}
85
 
178 benjamin 86
	public Protocole getProtocoleCourant() {
87
		return protocoleCourant;
88
	}
89
 
90
	public void setProtocoleCourant(Protocole protocoleCourant) {
91
		this.protocoleCourant = protocoleCourant;
92
	}
93
 
9 benjamin 94
}