Subversion Repositories eFlore/Applications.del

Rev

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

package org.tela_botanica.del.client.modeles;

public class MoyenneVote implements Comparable<MoyenneVote> {
        
        /**
         * Pourcentage de personne ayant voté pour la propostion,
         * un score de -1 indique qu'aucun vote n'a été effectué;
         */
        private int score = -1;
        
        private String intituleAssocie;
        
        private PropositionDetermination propositionAssociee;
        
        public MoyenneVote(int score, PropositionDetermination propositionAssociee) {
                this.score = score;
                this.intituleAssocie = propositionAssociee.getEspece();
                this.propositionAssociee = propositionAssociee;
        }

        public int getScore() {
                return score;
        }

        public void setScore(int score) {
                this.score = score;
        }

        public String getIntituleAssocie() {
                return intituleAssocie;
        }

        public void setIntituleAssocie(String intituleAssocie) {
                this.intituleAssocie = intituleAssocie;
        }
        
        public void setPropositionAssociee(PropositionDetermination propositionDetermination) {
                this.propositionAssociee = propositionDetermination;
        }
        
        public PropositionDetermination getPropositionAssociee() {
                return this.propositionAssociee;
        }

        @Override
        public int compareTo(MoyenneVote mv) {          
                if (mv.getScore() > this.score)  return 1; 
              else if(mv.getScore() == this.score) return 0; 
              else return -1; 
        }
}