goldman.collection.tagged
Class TaggedElementComparator<T>
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TaggedElementComparator
public TaggedElementComparator(Comparator<? super T> comp)
compare
public int compare(TaggedElement<T,?> a,
TaggedElement<T,?> b)
- Specified by:
compare
in interface Comparator<TaggedElement<T,?>>
getTagComparator
public Comparator<? super T> getTagComparator()