Class RatingsPage.RatingModel

    • Constructor Detail

      • RatingModel

        public RatingModel()
    • Method Detail

      • isActive

        public boolean isActive​(int star)
        Returns whether the star should be rendered active.
        Parameters:
        star - the number of the star
        Returns:
        true when the star is active
      • getNrOfVotes

        public Integer getNrOfVotes()
        Gets the number of cast votes.
        Returns:
        the number of cast votes.
      • addRating

        public void addRating​(int nrOfStars)
        Adds the vote from the user to the total of votes, and calculates the rating.
        Parameters:
        nrOfStars - the number of stars the user has cast
      • getRating

        public Double getRating()
        Gets the rating.
        Returns:
        the rating
      • getSumOfRatings

        public int getSumOfRatings()
        Returns the sum of the ratings.
        Returns:
        the sum of the ratings.