TUM CCSM Commons

edu.tum.cs.commons.collections
Class IdComparator<I extends java.lang.Comparable<I>,T>

java.lang.Object
  extended by edu.tum.cs.commons.collections.IdentifierBasedComparatorBase<I,T>
      extended by edu.tum.cs.commons.collections.IdComparator<I,T>
All Implemented Interfaces:
java.util.Comparator<T>

public class IdComparator<I extends java.lang.Comparable<I>,T>
extends IdentifierBasedComparatorBase<I,T>

Comparator that compares objects based on the identifiers provided by a IIdProvider.

Version:
$Rev: 26283 $
Author:
deissenb, $Author: juergens $
Rating:
GREEN Hash: 3F2D6549B37B7E5FF4BC2F5E98EC0A29

Constructor Summary
IdComparator(IIdProvider<I,T> idProvider)
          Create new comparator.
 
Method Summary
protected  I obtainIdentifier(T t)
          Obtain identifier from identifier provider.
 
Methods inherited from class edu.tum.cs.commons.collections.IdentifierBasedComparatorBase
compare
 
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

IdComparator

public IdComparator(IIdProvider<I,T> idProvider)
Create new comparator.

Method Detail

obtainIdentifier

protected I obtainIdentifier(T t)
Obtain identifier from identifier provider.

Specified by:
obtainIdentifier in class IdentifierBasedComparatorBase<I extends java.lang.Comparable<I>,T>
Throws:
java.lang.NullPointerException - if the id provider returns null.

TUM CCSM Commons

TUM CCSM Commons - 2.7