Package com.tangosol.net.partition
Class SimpleAssignmentStrategy.AnalysisContext.LoadComparator
- java.lang.Object
 - 
- com.tangosol.net.partition.SimpleAssignmentStrategy.AnalysisContext.LoadComparator
 
 
- 
- All Implemented Interfaces:
 Comparator
- Enclosing class:
 - SimpleAssignmentStrategy.AnalysisContext
 
public class SimpleAssignmentStrategy.AnalysisContext.LoadComparator extends Object implements Comparator
LoadComparator is a Comparator that can be used to compare two Member objects based on their partition load (as defined by the LoadCalculator).A member is ordered "lower" than another member if it has a lower member load (as determined by the LoadCalculator). Members with equivalent loads are ordered equivalently.
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.
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected booleanm_fPrimaryFlag for primary or backup load comparison. 
- 
Constructor Summary
Constructors Constructor Description LoadComparator(boolean fPrimary)Construct a LoadComparator. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(Object o1, Object o2)booleanisPrimary()Return true iff the comparator should use the primary load.- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong 
 - 
 
 - 
 
- 
- 
Method Detail
- 
isPrimary
public boolean isPrimary()
Return true iff the comparator should use the primary load.- Returns:
 - true iff the comparator should use the primary load
 
 
- 
compare
public int compare(Object o1, Object o2)
- Specified by:
 comparein interfaceComparator
 
 - 
 
 -