class CandidatePrioritizer extends Object implements Comparator<Candidate<?>>
Constructor and Description |
---|
CandidatePrioritizer() |
Modifier and Type | Method and Description |
---|---|
int |
compare(Candidate<?> c1,
Candidate<?> c2)
Compares the two Candidates based on their priority and
returns a negative integer, zero, or a positive integer as the first
Candidate has a lower, equal, or greater priority than the
second.
|
static int |
compareCandidates(Candidate<?> c1,
Candidate<?> c2)
Compares the two Candidates based on their priority and
returns a negative integer, zero, or a positive integer as the first
Candidate has a lower, equal, or greater priority than the
second.
|
boolean |
equals(Object obj)
Indicates whether some other object is "equal 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 static int compareCandidates(Candidate<?> c1, Candidate<?> c2)
c1
- the first Candidate to compare.c2
- the second Candidate to compare.public int compare(Candidate<?> c1, Candidate<?> c2)
compare
in interface Comparator<Candidate<?>>
c1
- the first Candidate to compare.c2
- the second Candidate to compare.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<Candidate<?>>
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(Object)
,
Object.hashCode()
Copyright © 2018. All rights reserved.