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 Details

  • Method Details

    • compare

      public int compare(Person p1, Person p2)
      Compares two Persons. 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 interface Comparator<Person>
    • equals

      public boolean equals(Object o)
      Compares one PersonSorter to another. All PersonSorters are the same.
      Specified by:
      equals in interface Comparator<Person>
      Overrides:
      equals in class Object