public class SimpleAssignmentStrategy.AnalysisContext.StrengthComparator extends Object implements Comparator
A member is ordered "lower" than another member if it has a larger combined distance from the reference members (ownership) (i.e. it is "stronger"). Members with equivalent distances are ordered arbitrarily.
Note: This comparator does not define an ordering that is "consistent with equals". If used in a context requiring such a natural ordering, it should be chained with comparator that does provide a natural ordering.
| Modifier and Type | Field and Description | 
|---|---|
protected Ownership | 
m_owners
The ownership. 
 | 
| Constructor and Description | 
|---|
StrengthComparator(Ownership owners)
Construct a StrengthComparator for the specified reference ownership. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
compare(Object o1,
       Object o2) | 
protected int | 
getDistance(Member member)
Return the "distance" of the specified member from the reference
 ownership. 
 | 
protected int | 
getDistance(Member member1,
           Member member2)
Return the "distance" between the specified members. 
 | 
Ownership | 
getOwnership()
Return the ownership to use in comparing member strength. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongprotected Ownership m_owners
public StrengthComparator(Ownership owners)
owners - the ownership, from which to determine member
                strengthpublic Ownership getOwnership()
public int compare(Object o1, Object o2)
compare in interface Comparatorprotected int getDistance(Member member)
member - the member to return the distance for