org.chorem.pollen.votecounting.business
Class Choice

java.lang.Object
  extended by org.chorem.pollen.votecounting.business.Choice
All Implemented Interfaces:
ListBehavior<Group>, PercentageBehavior

public class Choice
extends Object
implements ListBehavior<Group>, PercentageBehavior

Cette classe décrit le choix d'un sondage. Sa valeur sera modifiée au moment de l'exécution de la méthode de dépouillement.

Version:
$Id: Choice.java 3122 2012-01-30 20:43:30Z tchemit $
Author:
fdesbois

Constructor Summary
Choice(String id)
          Constructeur
Choice(String id, String name)
          Constructeur
 
Method Summary
 void addGroup(String idGroup, double weight)
          addGroup : Ajout d'un groupe lié au choix
 Group getGroup(String idGroup)
          getGroup : Renvoie un groupe existant dans la map
 List<Group> getGroups()
          getGroups : Renvoie la map des groupes
 String getIdChoice()
          getId : Renvoie l'identifiant du choix
 String getName()
          getName : Renvoie le nom du choix
 double getValue()
          getValue : Renvoie la valeur du choix
 List<Group> list()
           
 void setValue(double value)
          setValue : Mise à jour de la valeur du choix
 String toString()
           
 double value()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Choice

public Choice(String id)
Constructeur

Parameters:
id - : identifiant du choix

Choice

public Choice(String id,
              String name)
Constructeur

Parameters:
id - : identifiant du choix
name - : nom du choix
Method Detail

setValue

public void setValue(double value)
setValue : Mise à jour de la valeur du choix

Parameters:
value - : nouvelle valeur

getValue

public double getValue()
getValue : Renvoie la valeur du choix

Returns:
valeur courante du choix

getIdChoice

public String getIdChoice()
getId : Renvoie l'identifiant du choix

Returns:
identifiant du choix

getName

public String getName()
getName : Renvoie le nom du choix

Returns:
nom du choix

getGroups

public List<Group> getGroups()
getGroups : Renvoie la map des groupes

Returns:
map des groupes pour ce choix

addGroup

public void addGroup(String idGroup,
                     double weight)
addGroup : Ajout d'un groupe lié au choix

Parameters:
weight - : poids du groupe dans le sondage
idGroup - : identifiant du groupe

getGroup

public Group getGroup(String idGroup)
getGroup : Renvoie un groupe existant dans la map

Parameters:
idGroup - : identifiant du groupe dans la map
Returns:
le groupe ayant l'identifiant idGroup

value

public double value()
Specified by:
value in interface PercentageBehavior

list

public List<Group> list()
Specified by:
list in interface ListBehavior<Group>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012 CodeLutin. All Rights Reserved.