org.echarts.servlet.sip.appRouter.DFCRouterImpl
Class OriginatingPrecedenceComparator

java.lang.Object
  extended by org.echarts.servlet.sip.appRouter.DFCRouterImpl.OriginatingPrecedenceComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<Application>

public class OriginatingPrecedenceComparator
extends java.lang.Object
implements java.io.Serializable, java.util.Comparator<Application>

This class provides a comparator for comparing two originating region applications. Since comparators must provide a total ordering consistent with equals, this comparator provides more ordering than the partial ordering needed by DFC.

Author:
khp
See Also:
Serialized Form

Constructor Summary
OriginatingPrecedenceComparator()
           
 
Method Summary
 int compare(Application a1, Application a2)
          Compare two objects.
 
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
 

Constructor Detail

OriginatingPrecedenceComparator

public OriginatingPrecedenceComparator()
Method Detail

compare

public int compare(Application a1,
                   Application a2)
Compare two objects.

Specified by:
compare in interface java.util.Comparator<Application>
Returns:
integer which is greater than, less than or equal to 0 depending on the relative originating region precedence of the two applications being compared.
Throws:
java.lang.ClassCastException - if object is not an application object