public abstract class RankingComparator extends Object implements Comparator<org.osgi.framework.ServiceReference<?>>
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 elements the one to
use last.Modifier and Type | Field and Description |
---|---|
static Comparator<org.osgi.framework.ServiceReference<?>> |
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 Comparator<org.osgi.framework.ServiceReference<?>> |
SRV_RANKING
Implements a comparator to sort arrays and sets according to the
specification of the
service.ranking property. |
Constructor and Description |
---|
RankingComparator() |
Modifier and Type | Method and Description |
---|---|
protected int |
getInteger(org.osgi.framework.ServiceReference<?> sr,
String property) |
protected long |
getLong(org.osgi.framework.ServiceReference<?> sr,
String property) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static Comparator<org.osgi.framework.ServiceReference<?>> SRV_RANKING
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:
< 0
if obj1 has higher ranking than obj2== 0
if obj1 and obj2 reference the same service> 0
if obj1 has lower ranking than obj2public static Comparator<org.osgi.framework.ServiceReference<?>> CM_RANKING
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, however we order it
by service id, lowest last. Thus the results of this
comparator are as follows:
< 0
if obj1 has lower ranking than obj2== 0
if obj1 and obj2 have the same ranking> 0
if obj1 has higher ranking than obj2Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.