org.glassfish.jersey.model.internal
Class RankedComparator<T>

java.lang.Object
  extended by org.glassfish.jersey.model.internal.RankedComparator<T>
Type Parameters:
T - Type of the elements to be sorted.
All Implemented Interfaces:
Comparator<RankedProvider<T>>

public class RankedComparator<T>
extends Object
implements Comparator<RankedProvider<T>>

Comparator used to sort types by their priorities defined by theirs binding priority set during the configuration phase (Configuration) in ranked provider.

Author:
Miroslav Fuksa (miroslav.fuksa at oracle.com), Michal Gajdos (michal.gajdos at oracle.com)

Nested Class Summary
static class RankedComparator.Order
          Defines which ordering should be used for sorting.
 
Constructor Summary
RankedComparator()
           
RankedComparator(RankedComparator.Order order)
           
 
Method Summary
 int compare(RankedProvider<T> o1, RankedProvider<T> o2)
           
protected  int getPriority(RankedProvider<T> rankedProvider)
           
 
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

RankedComparator

public RankedComparator()

RankedComparator

public RankedComparator(RankedComparator.Order order)
Method Detail

compare

public int compare(RankedProvider<T> o1,
                   RankedProvider<T> o2)
Specified by:
compare in interface Comparator<RankedProvider<T>>

getPriority

protected int getPriority(RankedProvider<T> rankedProvider)


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.