org.jscience.politics.vote
Class BinaryBallot

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

public class BinaryBallot
extends Ballot

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


Constructor Summary
BinaryBallot()
          Creates a new BinaryBallot 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!
 java.util.Set getOptionsForChoice(java.lang.String title)
          DOCUMENT ME!
 boolean isOptionSelected(java.lang.String title, java.lang.String option)
          DOCUMENT ME!
 void setSelectionForOption(java.lang.String title, java.lang.String option, boolean selected)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryBallot

public BinaryBallot()
Creates a new BinaryBallot 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!

setSelectionForOption

public void setSelectionForOption(java.lang.String title,
                                  java.lang.String option,
                                  boolean selected)
DOCUMENT ME!

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

clone

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

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