Defines a method that a type implements to compare two objects.
Public Interface IComparer(Of T)
Dim instance As IComparer(Of T)
public interface IComparer<T>
generic<typename T> public interface class IComparer
JScript does not support generic types or methods.
The type of objects to compare.
This interface is used with the List<(Of <(T>)>)..::.Sort and List<(Of <(T>)>)..::.BinarySearch methods. It provides a way to customize the sort order of a collection. Classes that implement this interface include the SortedDictionary<(Of <(TKey, TValue>)>) and SortedList<(Of <(TKey, TValue>)>) generic classes.
The default implementation of this interface is the Comparer<(Of <(T>)>) class. The StringComparer class implements this interface for type String.
This interface supports ordering comparisons. That is, when the Compare method returns 0, it means that two objects sort the same. Implementation of exact equality comparisons is provided by the IEqualityComparer<(Of <(T>)>) generic interface.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune