Subversion Repositories eFlore/Applications.del

Rev

Rev 224 | Rev 230 | 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
 
11
	private Observation currentObservation;
73 benjamin 12
 
147 benjamin 13
	private Image imageCourante;
14
 
73 benjamin 15
	private String taxonPourRechercheEflore;
178 benjamin 16
 
17
	private Protocole protocoleCourant;
9 benjamin 18
 
147 benjamin 19
	private List<Image> images;
20
 
21
	private int numPageRechercheImage = 0;
22
 
23
	private int pasPageRechercheImage = 10;
24
 
14 benjamin 25
	private static CacheClient instance;
9 benjamin 26
 
14 benjamin 27
	private CacheClient() {
9 benjamin 28
		instance = this;
29
	}
30
 
14 benjamin 31
	public Observation getCurrentObservation() {
9 benjamin 32
		return currentObservation;
33
	}
34
 
14 benjamin 35
	public void setCurrentObservation(Observation currentObservation) {
9 benjamin 36
		this.currentObservation = currentObservation;
37
	}
38
 
14 benjamin 39
	public static CacheClient getInstance() {
9 benjamin 40
		if (instance == null) {
14 benjamin 41
			instance = new CacheClient();
9 benjamin 42
		}
43
		return instance;
44
	}
45
 
73 benjamin 46
	public String getTaxonPourRechercheEflore() {
47
		return taxonPourRechercheEflore;
48
	}
49
 
50
	public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
51
		this.taxonPourRechercheEflore = taxonPourRechercheEflore;
52
	}
53
 
147 benjamin 54
	public int getNumPageRechercheImage() {
55
		return numPageRechercheImage;
56
	}
57
 
58
	public void setNumPageRechercheImage(int numPageRechercheImage) {
59
		this.numPageRechercheImage = numPageRechercheImage;
60
	}
61
 
62
	public int getPasPageRechercheImage() {
63
		return pasPageRechercheImage;
64
	}
65
 
66
	public void setPasPageRechercheImage(int pasPageRechercheImage) {
67
		this.pasPageRechercheImage = pasPageRechercheImage;
68
	}
69
 
70
	public List<Image> getImages() {
71
		return images;
72
	}
224 aurelien 73
 
74
	public List<Image> getSousListeImages(int premiere, int derniere) {
226 aurelien 75
		if(derniere > images.size() - 1) {
76
			derniere = images.size() - 1;
77
		}
224 aurelien 78
		return images.subList(premiere, derniere);
79
	}
147 benjamin 80
 
81
	public void setImages(List<Image> images) {
82
		this.images = images;
83
	}
84
 
85
	public Image getImageCourante() {
86
		return imageCourante;
87
	}
88
 
89
	public void setImageCourante(Image imageCourante) {
90
		this.imageCourante = imageCourante;
91
	}
92
 
178 benjamin 93
	public Protocole getProtocoleCourant() {
94
		return protocoleCourant;
95
	}
96
 
97
	public void setProtocoleCourant(Protocole protocoleCourant) {
98
		this.protocoleCourant = protocoleCourant;
99
	}
100
 
9 benjamin 101
}