Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.net.partition
Class SimpleAssignmentStrategy.AnalysisContext.LoadComparator

java.lang.Object
  extended by com.tangosol.net.partition.SimpleAssignmentStrategy.AnalysisContext.LoadComparator

All Implemented Interfaces:
java.util.Comparator
Enclosing class:
SimpleAssignmentStrategy.AnalysisContext

public class SimpleAssignmentStrategy.AnalysisContext.LoadComparator
extends java.lang.Object
implements java.util.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
protected  boolean m_fPrimary
          Flag for primary or backup load comparison.

 

Constructor Summary
SimpleAssignmentStrategy.AnalysisContext.LoadComparator(boolean fPrimary)
          Construct a LoadComparator.

 

Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          
 boolean isPrimary()
          Return true iff the comparator should use the primary load.

 

Methods inherited from interface java.util.Comparator
equals

 

Field Detail

m_fPrimary

protected boolean m_fPrimary
Flag for primary or backup load comparison.

Constructor Detail

SimpleAssignmentStrategy.AnalysisContext.LoadComparator

public SimpleAssignmentStrategy.AnalysisContext.LoadComparator(boolean fPrimary)
Construct a LoadComparator.
Parameters:
fPrimary - true if the comparator should use the primary load, or false for backup load

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(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.