de.jstacs.parameters
Class ParameterSetTagger.RankEntryComparator<K,V>

java.lang.Object
  extended by de.jstacs.parameters.ParameterSetTagger.RankEntryComparator<K,V>
Type Parameters:
K - the type of the key
V - the type of the value
All Implemented Interfaces:
Comparator<Map.Entry<K,ComparableElement<V,Integer>>>
Enclosing class:
ParameterSetTagger

public class ParameterSetTagger.RankEntryComparator<K,V>
extends Object
implements Comparator<Map.Entry<K,ComparableElement<V,Integer>>>

This class implements a comparator on Map.Entry where value is a ComparableElement with weight Integer. This class allows, for instance, to sort the Parameter in a ParameterSetTagger as given in the constructor.

Author:
Jens Keilwagen

Constructor Summary
ParameterSetTagger.RankEntryComparator()
          Creates a Comparator that only compares the ranks of Map.Entrys where the rank is determined by the ParameterSet.parameters.
 
Method Summary
 int compare(Map.Entry<K,ComparableElement<V,Integer>> o1, Map.Entry<K,ComparableElement<V,Integer>> o2)
           
 
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

ParameterSetTagger.RankEntryComparator

public ParameterSetTagger.RankEntryComparator()
Creates a Comparator that only compares the ranks of Map.Entrys where the rank is determined by the ParameterSet.parameters.

Method Detail

compare

public int compare(Map.Entry<K,ComparableElement<V,Integer>> o1,
                   Map.Entry<K,ComparableElement<V,Integer>> o2)
Specified by:
compare in interface Comparator<Map.Entry<K,ComparableElement<V,Integer>>>