org.apache.felix.ipojo.util

## Class ServiceReferenceRankingComparator

- java.lang.Object
- - org.apache.felix.ipojo.util.ServiceReferenceRankingComparator

All Implemented Interfaces:
  java.io.Serializable, java.util.Comparator<org.osgi.framework.ServiceReference>

    public class ServiceReferenceRankingComparator
    extends java.lang.Object
    implements java.util.Comparator<org.osgi.framework.ServiceReference>, java.io.Serializable

Service Reference Comparator. This comparator follows OSGi Ranking policy.

Author:
  Felix Project Team
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`ServiceReferenceRankingComparator()`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compare(org.osgi.framework.ServiceReference ref1, org.osgi.framework.ServiceReference ref2)` Compares two service reference.

### 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

`comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

### Constructor Detail

#### ServiceReferenceRankingComparator

    public ServiceReferenceRankingComparator()

### Method Detail

#### compare

    public int compare(org.osgi.framework.ServiceReference ref1,
                       org.osgi.framework.ServiceReference ref2)

Compares two service reference.

Specified by:
  `compare` in interface `java.util.Comparator<org.osgi.framework.ServiceReference>`
Parameters:
  `ref1` - the reference 1
  `ref2` - the reference 2
Returns:
  `-1` if the reference 1 is 'higher' than the reference 2, `1` otherwise. (higher is term of ranking means a lower index)
See Also:
  `Comparator.compare(java.lang.Object, java.lang.Object)`