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
Person
s by their id.-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
PersonSorter
-
-
Method Details
-
compare
Compares twoPerson
s. 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:
compare
in interfaceComparator<Person>
-
equals
Compares onePersonSorter
to another. AllPersonSorter
s are the same.- Specified by:
equals
in interfaceComparator<Person>
- Overrides:
equals
in classObject
-