Subversion Repositories eFlore/Applications.del

Rev

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

package org.tela_botanica.del.client.cache;

import java.util.List;

import org.tela_botanica.del.client.modeles.Image;
import org.tela_botanica.del.client.modeles.Observation;
import org.tela_botanica.del.client.modeles.Protocole;

public class CacheClient {

        private Observation observationCourante;
        private Image imageCourante;
        private String taxonPourRechercheEflore;
        private Protocole protocoleCourant;
        private List<Image> images;
        private int numPageRechercheImage = 0;
        private int paginationPasRechercheImage = 10;
        private static CacheClient instance;

        private CacheClient() {
                instance = this;
        }

        public Observation getObservationCourante() {
                return observationCourante;
        }

        public void setObservationCourante(Observation observationCourante) {
                this.observationCourante = observationCourante;
        }

        public static CacheClient getInstance() {
                if (instance == null) {
                        instance = new CacheClient();
                }
                return instance;
        }

        public String getTaxonPourRechercheEflore() {
                return taxonPourRechercheEflore;
        }

        public void setTaxonPourRechercheEflore(String taxonPourRechercheEflore) {
                this.taxonPourRechercheEflore = taxonPourRechercheEflore;
        }

        public int getNumPageRechercheImage() {
                return numPageRechercheImage;
        }

        public void setNumPageRechercheImage(int numPageRechercheImage) {
                this.numPageRechercheImage = numPageRechercheImage;
        }

        public int getPaginationPasRechercheImage() {
                return paginationPasRechercheImage;
        }

        public void setPaginationPasRerchercheImage(int paginationPas) {
                this.paginationPasRechercheImage = paginationPas;
        }

        public List<Image> getImages() {
                return images;
        }

        public List<Image> getSousListeImages(int premiere, int derniere) {
                if (derniere > images.size() - 1) {
                        derniere = images.size() - 1;
                }
                return images.subList(premiere, derniere);
        }

        public void setImages(List<Image> images) {
                this.images = images;
        }

        public Image getImageCourante() {
                return imageCourante;
        }

        public void setImageCourante(Image imageCourante) {
                this.imageCourante = imageCourante;
        }

        public Protocole getProtocoleCourant() {
                return protocoleCourant;
        }

        public void setProtocoleCourant(Protocole protocoleCourant) {
                this.protocoleCourant = protocoleCourant;
        }

}