Class Movie.Order

java.lang.Object
cs1302.oracle.model.Movie.Order
Enclosing class:
Movie

public static class Movie.Order extends Object
Implementations of Comparable<Movie> that impose various orderings.
  • Method Details

    • by

      public static <R extends Comparable<? super R>> Comparator<Movie> by(Movie.Mapper<R> mapper)
      Returns a comparator for Movie objects that performs comparisons using the natural ordering of the results of applying the given mapper function to the person objects under comparison.
      Type Parameters:
      R - the return type of mapper.apply(Movie)
      Parameters:
      mapper - a function that returns a comparable value for a person
      Returns:
      a comparator for Movie objects
    • byName

      public static Comparator<Movie> byName()
      Returns a comparator for Movie 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

      public static Comparator<Movie> byRating()
      Returns a comparator for Movie 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

      public static Comparator<Movie> byRuntime()
      Returns a comparator for Movie 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

      public static Comparator<Movie> byTagline()
      Returns a comparator for Movie 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

      public static Comparator<Movie> byYear()
      Returns a comparator for Movie 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