Class IdentityHashComparator<T>
- java.lang.Object
-
- psidev.psi.mi.jami.utils.comparator.IdentityHashComparator<T>
-
- All Implemented Interfaces:
Comparator<T>
,MIComparator<T>
public class IdentityHashComparator<T> extends Object implements MIComparator<T>
The IdentityHashComparator will use the hashcode of each objects to compare the objects.- Since:
14/11/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description IdentityHashComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(T t, T t2)
Compares two objects based on their hashcode methodsint
computeHashCode(T object)
computeHashCode-
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(T t, T t2)
Compares two objects based on their hashcode methods- Specified by:
compare
in interfaceComparator<T>
- Parameters:
t
- a T object.t2
- a T object.- Returns:
- a int.
-
computeHashCode
public int computeHashCode(T object)
computeHashCode
- Specified by:
computeHashCode
in interfaceMIComparator<T>
- Parameters:
object
- a T object.- Returns:
- a int.
-
-