Package edu.pdx.cs410J.family
Class PrettyPrinter.PersonSorter
java.lang.Object
edu.pdx.cs410J.family.PrettyPrinter.PersonSorter
- All Implemented Interfaces:
Comparator<Person>
- Enclosing class:
- PrettyPrinter
Inner class used only by the dump method. It is used to sort
Persons by their id.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
PersonSorter
-
-
Method Details
-
compare
Compares twoPersons. If the id of person one is less than the id of person two, then person one is less than person two. If the id of person one is greater than the id of person two, then person one greater than person two. If the id of person one is equal to the id of person two, then the two persons are equal.- Specified by:
comparein interfaceComparator<Person>
-
equals
Compares onePersonSorterto another. AllPersonSorters are the same.- Specified by:
equalsin interfaceComparator<Person>- Overrides:
equalsin classObject
-