public class QualityComparator extends java.lang.Object implements java.util.Comparator<AcceptLanguageEntry>
AcceptLanguageEntry
objects by their quality value.
The highest value will be the first in the list.Modifier and Type | Method and Description |
---|---|
int |
compare(AcceptLanguageEntry o1,
AcceptLanguageEntry o2)
Returns -1 if
o1.getQuality() is less than o2.getQuality() , 0 is they are
equal and 1 if o1.getQuality() is greater than o2.getQuality() . |
static QualityComparator |
getInstance() |
public static QualityComparator getInstance()
public int compare(AcceptLanguageEntry o1, AcceptLanguageEntry o2)
o1.getQuality()
is less than o2.getQuality()
, 0 is they are
equal and 1 if o1.getQuality()
is greater than o2.getQuality()
. (Note that lists
sorted with this method will the contains the highest quality values at first.)compare
in interface java.util.Comparator<AcceptLanguageEntry>
Comparator.compare(java.lang.Object, java.lang.Object)