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

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

Finds the maximum value in a collection.

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

Syntax


public static T Maximum<T>(
	IEnumerable<T> collection
)
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) _
) 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
)

Type Parameters

T
The type of items in the collection.

Parameters

collection
Type: IEnumerable<(Of <(<'T>)>)>
The collection to search.

Return Value

The largest item in the collection.

Exceptions


ExceptionCondition
InvalidOperationExceptionThe collection is empty.
ArgumentNullExceptioncollection is null.

Remarks


Values in the collection are compared by using the IComparable<T> interfaces implementation on the type T.