public class Person.NameComparator extends Object implements Comparator<Person>
Comparator
implementation for comparing persons based on their names.Constructor and Description |
---|
Person.NameComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(Person o1,
Person o2)
Compares two persons' names for ascending order sorting.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
public int compare(Person o1, Person o2)
compare
in interface Comparator<Person>
o1
- the first Person to be comparedo2
- the second Person to be compared