org.jscience.politics.vote
Class RankedBallot

java.lang.Object
  extended by org.jscience.politics.vote.Ballot
      extended by org.jscience.politics.vote.RankedBallot
All Implemented Interfaces:
java.lang.Cloneable

public class RankedBallot
extends Ballot

This class represents the different choices available to someone in a specific vote session. You should vote using numbers from the prefered to the less prefered.


Constructor Summary
RankedBallot()
          Creates a new RankedBallot object.
 
Method Summary
 void addChoice(java.lang.String title)
          DOCUMENT ME!
 void addOptionToChoice(java.lang.String title, java.lang.String option)
          DOCUMENT ME!
 java.lang.Object clone()
          DOCUMENT ME!
 java.util.Set getChoices()
          DOCUMENT ME!
 int getOptionSelection(java.lang.String title, java.lang.String option)
          DOCUMENT ME!
 java.util.Set getOptionsForChoice(java.lang.String title)
          DOCUMENT ME!
 boolean isOptionSelected(java.lang.String title, java.lang.String option)
          DOCUMENT ME!
 void setOptionSelection(java.lang.String title, java.lang.String option, int value)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankedBallot

public RankedBallot()
Creates a new RankedBallot object.

Method Detail

addChoice

public void addChoice(java.lang.String title)
DOCUMENT ME!

Specified by:
addChoice in class Ballot
Parameters:
title - DOCUMENT ME!

addOptionToChoice

public void addOptionToChoice(java.lang.String title,
                              java.lang.String option)
DOCUMENT ME!

Specified by:
addOptionToChoice in class Ballot
Parameters:
title - DOCUMENT ME!
option - DOCUMENT ME!

getChoices

public java.util.Set getChoices()
DOCUMENT ME!

Specified by:
getChoices in class Ballot
Returns:
DOCUMENT ME!

getOptionsForChoice

public java.util.Set getOptionsForChoice(java.lang.String title)
DOCUMENT ME!

Specified by:
getOptionsForChoice in class Ballot
Parameters:
title - DOCUMENT ME!
Returns:
DOCUMENT ME!

isOptionSelected

public boolean isOptionSelected(java.lang.String title,
                                java.lang.String option)
DOCUMENT ME!

Specified by:
isOptionSelected in class Ballot
Parameters:
title - DOCUMENT ME!
option - DOCUMENT ME!
Returns:
DOCUMENT ME!

getOptionSelection

public int getOptionSelection(java.lang.String title,
                              java.lang.String option)
DOCUMENT ME!

Parameters:
title - DOCUMENT ME!
option - DOCUMENT ME!
Returns:
DOCUMENT ME!

setOptionSelection

public void setOptionSelection(java.lang.String title,
                               java.lang.String option,
                               int value)
DOCUMENT ME!

Parameters:
title - DOCUMENT ME!
option - DOCUMENT ME!
value - DOCUMENT ME!

clone

public java.lang.Object clone()
DOCUMENT ME!

Specified by:
clone in class Ballot
Returns:
DOCUMENT ME!