Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Movie;
- enum MovieRating {
- NOT_RATED,
- AWFUL(0),
- BAD(2),
- MEDIOCRE(4),
- GOOD(6),
- EXCELLENT(8),
- MASTERPIECE(10);
- private final int puntuacion;
- public int getNumericRating() {
- return puntuacion;
- }
- private MovieRating(int puntuacion) {
- this.puntuacion = puntuacion;
- }
- private MovieRating() {
- this.puntuacion = -1;
- }
- MovieRating mr;
- public boolean isBetterThan(MovieRating mr){
- if(this.getNumericRating() > mr.getNumericRating() || mr == MovieRating.NOT_RATED){
- return true;
- }else return false;
- }
- } ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement