|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ora.jsp.beans.poll.PollBean
This class maintains a list of answers in an online poll application. It's only intended as an example.
Field Summary | |
private int |
answer1
|
private int |
answer2
|
private int |
answer3
|
private int |
total
|
Constructor Summary | |
PollBean()
|
Method Summary | |
int |
getAnswer1()
Returns the number of alternative 1 answers. |
int |
getAnswer1Percent()
Returns the percentage of alternative 1 answers. |
int |
getAnswer2()
Returns the number of alternative 2 answers. |
int |
getAnswer2Percent()
Returns the percentage of alternative 2 answers. |
int |
getAnswer3()
Returns the number of alternative 3 answers. |
int |
getAnswer3Percent()
Returns the percentage of alternative 3 answers. |
private int |
getPercent(int total,
int answer)
Returns an int representing the rounded percentage of answers. |
int |
getTotal()
Returns the total number of answers. |
void |
setAnswer(AnswerBean answer)
Increments the counter matching the answer as well as the total number of answers. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int total
private int answer1
private int answer2
private int answer3
Constructor Detail |
public PollBean()
Method Detail |
public void setAnswer(AnswerBean answer)
public int getTotal()
public int getAnswer1()
public int getAnswer2()
public int getAnswer3()
public int getAnswer1Percent()
public int getAnswer2Percent()
public int getAnswer3Percent()
private int getPercent(int total, int answer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |