|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.examples.ajax.builtin.RatingsPage.RatingModel
public static class RatingsPage.RatingModel
Rating model for storing the ratings, typically this comes from a database.
Constructor Summary | |
---|---|
RatingsPage.RatingModel()
|
Method Summary | |
---|---|
void |
addRating(int nrOfStars)
Adds the vote from the user to the total of votes, and calculates the rating. |
Integer |
getNrOfVotes()
Gets the number of cast votes. |
Double |
getRating()
Gets the rating. |
int |
getSumOfRatings()
Returns the sum of the ratings. |
boolean |
isActive(int star)
Returns whether the star should be rendered active. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RatingsPage.RatingModel()
Method Detail |
---|
public boolean isActive(int star)
star
- the number of the star
public Integer getNrOfVotes()
public void addRating(int nrOfStars)
nrOfStars
- the number of stars the user has castpublic Double getRating()
public int getSumOfRatings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |