Class ListComparator

  • All Implemented Interfaces:
    java.io.Serializable, java.util.Comparator

    public class ListComparator
    extends java.lang.Object
    implements java.util.Comparator, java.io.Serializable
    Comparator for comparing lists of Comparable objects.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ListComparator()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object o1, java.lang.Object o2)
      Compare two lists of Comparable objects.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • ListComparator

        public ListComparator()
    • Method Detail

      • compare

        public int compare​(java.lang.Object o1,
                           java.lang.Object o2)
        Compare two lists of Comparable objects.
        Specified by:
        compare in interface java.util.Comparator
        Parameters:
        o1 - the first object to be compared.
        o2 - the second object to be compared.
        Throws:
        java.lang.ClassCastException - if any of the lists contains an object that is not Comparable.