goldman.collection.tagged
Class TaggedElementComparator<T>

java.lang.Object
  extended by goldman.collection.tagged.TaggedElementComparator<T>
All Implemented Interfaces:
Comparator<TaggedElement<T,?>>

public class TaggedElementComparator<T>
extends Object
implements Comparator<TaggedElement<T,?>>

We compare tagged elements by wrapping a provided comparator defined over only the tags. That is, our comparator wraps a comparator of type T and supports comparison of tagged elements whose tag type is T.


Constructor Summary
TaggedElementComparator(Comparator<? super T> comp)
           
 
Method Summary
 int compare(TaggedElement<T,?> a, TaggedElement<T,?> b)
           
 Comparator<? super T> getTagComparator()
           
 
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

TaggedElementComparator

public TaggedElementComparator(Comparator<? super T> comp)
Method Detail

compare

public int compare(TaggedElement<T,?> a,
                   TaggedElement<T,?> b)
Specified by:
compare in interface Comparator<TaggedElement<T,?>>

getTagComparator

public Comparator<? super T> getTagComparator()