Wintellect.PowerCollections Namespace
Algorithms Class
Algorithms Methods
GhostDoc Pro Sample Help File

Algorithms..::..Maximum<(Of <(<'T>)>)> Method (IEnumerable<(Of <(<'T>)>)>, IComparer<(Of <(<'T>)>)>)

Finds the maximum value in a collection. A supplied IComparer<T> is used to compare the items in the collection.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


public static T Maximum<T>(
	IEnumerable<T> collection,
	IComparer<T> comparer
)
where T : IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>
Public Shared Function Maximum(Of T As {IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T), IComparable(Of T)}) ( _
	collection As IEnumerable(Of T), _
	comparer As IComparer(Of T) _
) As T
public:
generic<typename T>
where T : IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>, IComparable<T>
static T Maximum(
	IEnumerable<T>^ collection, 
	IComparer<T>^ comparer
)

Type Parameters

T
The type of items in the collection.

Parameters

collection
Type: IEnumerable<(Of <(<'T>)>)>
The collection to search.
comparer
Type: IComparer<(Of <(<'T>)>)>
The comparer instance used to compare items in the collection.

Return Value

The largest item in the collection.

Exceptions


ExceptionCondition
InvalidOperationExceptionThe collection is empty.
ArgumentNullExceptioncollection or comparer is null.