org.apache.felix.cm.impl
Class RankingComparator

java.lang.Object
  extended by org.apache.felix.cm.impl.RankingComparator
All Implemented Interfaces:
java.util.Comparator

public abstract class RankingComparator
extends java.lang.Object
implements java.util.Comparator

The RankingComparator may be used to maintain sorted sets or to sort arrays such that the first element in the set or array is the one to use first and the last elementis the one to use last.


Field Summary
static java.util.Comparator CM_RANKING
          Implements a comparator to sort arrays and sets according to the specification of the service.cmRanking property in the Configuration Admin specification.
static java.util.Comparator SRV_RANKING
          Implements a comparator to sort arrays and sets according to the specification of the service.ranking property.
 
Constructor Summary
RankingComparator()
           
 
Method Summary
protected  long getLong(org.osgi.framework.ServiceReference sr, java.lang.String property)
           
 
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
compare, equals
 

Field Detail

SRV_RANKING

public static java.util.Comparator SRV_RANKING
Implements a comparator to sort arrays and sets according to the specification of the service.ranking property. This results in collections whose first element has the highest ranking and the last element has the lowest ranking. Thus the results of this comparator are as follows:


CM_RANKING

public static java.util.Comparator CM_RANKING
Implements a comparator to sort arrays and sets according to the specification of the service.cmRanking property in the Configuration Admin specification. This results in collections where the first element has the lowest ranking value and the last element has the highest ranking value. Order amongst elements with the same ranking value is left undefined. Thus the results of this comparator are as follows:

Constructor Detail

RankingComparator

public RankingComparator()
Method Detail

getLong

protected long getLong(org.osgi.framework.ServiceReference sr,
                       java.lang.String property)


Copyright © 2006-2012 The Apache Software Foundation. All Rights Reserved.