FileDocCategorySizeDatePackage
PollBean.javaAPI DocExample1118Tue Jun 08 11:26:42 BST 2004com.mycompany.poll

PollBean

public class PollBean extends Object
This class is a simple bean used for the quick poll example. It just keep track of three alternative votes and the total of votes.
author
Hans Bergsten, Gefion Software
version
1.0

Fields Summary
private int
vote1
private int
vote2
private int
vote3
private int
total
private boolean
showScore
Constructors Summary
Methods Summary
public booleangetShowScore()

	return showScore;
    
public intgetTotal()

	return total;
    
public doublegetVote1Score()

	return (int) Math.round(((double) vote1 / (double) total) * 100);
    
public doublegetVote2Score()

	return (int) Math.round(((double) vote2 / (double) total) * 100);
    
public doublegetVote3Score()

	return (int) Math.round(((double) vote3 / (double) total) * 100);
    
public java.lang.Stringvote1()

       
	vote1++;
	total++;
	showScore = true;
	return null;
    
public java.lang.Stringvote2()

	vote2++;
	total++;
	showScore = true;
	return null;
    
public java.lang.Stringvote3()

	vote3++;
	total++;
	showScore = true;
	return null;