public static class CandidatePair.PairComparator extends Object implements Comparator<CandidatePair>
Constructor and Description |
---|
PairComparator() |
Modifier and Type | Method and Description |
---|---|
int |
compare(CandidatePair pair1,
CandidatePair pair2)
Compares pair1 and pair2 for order.
|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" to this
Comparator.
|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public int compare(CandidatePair pair1, CandidatePair pair2)
compare
in interface Comparator<CandidatePair>
pair1
- the first CandidatePair to be compared.pair2
- the second CandidatePair to be compared.ClassCastException
- if the specified object's type prevents it
from being compared to this Object.public boolean equals(Object obj)
comp1.equals(comp2)
implies that
sgn(comp1.compare(o1,o2))==sgn(comp2.compare(o1, o2)) for
every object reference o1 and o2.Note that it is always safe not to override Object.equals(Object). However, overriding this method may, in some cases, improve performance by allowing programs to determine that two distinct Comparators impose the same order.
equals
in interface Comparator<CandidatePair>
equals
in class Object
obj
- the reference object with which to compare.true
only if the specified object is also
a comparator and it imposes the same ordering as this
comparator.Object.equals(java.lang.Object)
,
Object.hashCode()
Copyright © 2018. All rights reserved.