java.lang.Object
cs1302.oracle.model.Movie.Order
- Enclosing class:
- Movie
Implementations of
Comparable<Movie>
that
impose various orderings.-
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends Comparable<? super R>>
Comparator<Movie>by
(Movie.Mapper<R> mapper) Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the results of applying the givenmapper
function to the person objects under comparison.static Comparator<Movie>
byName()
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the name values of the movie objects under comparison.static Comparator<Movie>
byRating()
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the rating values of the movie objects under comparison.static Comparator<Movie>
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the runtime values of the movie objects under comparison.static Comparator<Movie>
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the tagline values of the movie objects under comparison.static Comparator<Movie>
byYear()
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the year values of the movie objects under comparison.
-
Method Details
-
by
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the results of applying the givenmapper
function to the person objects under comparison.- Type Parameters:
R
- the return type ofmapper.apply(Movie)
- Parameters:
mapper
- a function that returns a comparable value for a person- Returns:
- a comparator for
Movie
objects
-
byName
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the name values of the movie objects under comparison.- Returns:
- a comparator that compares
Movie
objects by name
-
byRating
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the rating values of the movie objects under comparison.- Returns:
- a comparator that compares
Movie
objects by rating
-
byRuntime
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the runtime values of the movie objects under comparison.- Returns:
- a comparator that compares
Movie
objects by runtime
-
byTagline
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the tagline values of the movie objects under comparison.- Returns:
- a comparator that compares
Movie
objects by tagline
-
byYear
Returns a comparator forMovie
objects that performs comparisons using the natural ordering of the year values of the movie objects under comparison.- Returns:
- a comparator that compares
Movie
objects by year
-