uk.ac.ebi.intact.util
Class InteractorComparator

java.lang.Object
  |
  +--uk.ac.ebi.intact.util.InteractorComparator
All Implemented Interfaces:
java.util.Comparator

public class InteractorComparator
extends java.lang.Object
implements java.util.Comparator

This class provides a specific Comparator for 'hidden' Interactors, based on short label. It should be used for Components which contain Interactor (eg Protein) instances.

Author:
Chris Lewington

Constructor Summary
InteractorComparator()
           
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          This method compares two Components and orders them according to the short label alphabetic ordering of their Interactors.
 
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

InteractorComparator

public InteractorComparator()
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
This method compares two Components and orders them according to the short label alphabetic ordering of their Interactors. The comparison is not case-sensitive.

Specified by:
compare in interface java.util.Comparator
Parameters:
obj1 -
obj2 -
Returns:
int -1 if obj1 is less than obj2, 0 if they are equal and 1 if obj1 is greater than obj2.
Throws:
java.lang.ClassCastException - thrown if the arguments are not Components.
java.lang.NullPointerException - if either or both arguments have no Protein shortLabel set.


IntAct Project - EMBL-EBI 2004 - intact-help@ebi.ac.uk