public class Rating
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static class |
Rating.ReviewType |
ReviewType enum that allows users to distinguish between CRITIC, AUDIENCE, or an average of both
|
Constructor | Description |
---|---|
Rating() |
noargs constructor in case the movie was not rated.
|
Rating(double criticScore,
int numCritics,
double audienceScore,
int numAudience) |
Constructor for ratings.
|
Modifier and Type | Method | Description |
---|---|---|
double |
getAudienceScore() |
Getter method to return the corresponding member variable.
|
double |
getAverageRating() |
Returns the average rating between both the critics and the audience.
|
double |
getCriticScore() |
Getter method to return the corresponding member variable.
|
int |
getNumAudience() |
Getter method to return the corresponding member variable.
|
int |
getNumCritics() |
Getter method to return the corresponding member variable.
|
static void |
main(java.lang.String[] args) |
|
java.lang.String |
toString() |
A String representing the Rating class.
|
public Rating(double criticScore, int numCritics, double audienceScore, int numAudience)
criticScore
- average score given by all criticsnumCritics
- number of critic reviewsaudienceScore
- average score given by general publicnumAudience
- number of audience reviewspublic Rating()
this
keyword.public double getAudienceScore()
public int getNumAudience()
public double getCriticScore()
public int getNumCritics()
public double getAverageRating()
public java.lang.String toString()
String.format(String, Object...)
with the following format specifiers
for the doubles: %.0f
Example: toString
in class java.lang.Object
public static void main(java.lang.String[] args)