Click or drag to resize
OSIsoft, LLC

AFCollectionTSort Method

Sorts the items in the entire collection using the default comparer.

Namespace:  OSIsoft.AF
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.8.440
Syntax
public void Sort()

Implements

IAFListSort
Exceptions
ExceptionCondition
InvalidOperationException If the size of the collection is too large to perform the operation. This occurs when the number of items in the collection is greater than a page size and the IsPaging property is .
Remarks

This method uses the default comparer for type T to determine the order of the items in the collection. If the item has a name, then the default comparer will normally sort the collection based upon the item's name.

This method uses Array.Sort, which uses the QuickSort algorithm. This implementation performs an unstable sort; that is, if two items are equal, their order might not be preserved. In contrast, a stable sort preserves the order of the items that are equal.

On average, this method is an O(n log n) operation, where n is Count; in the worst case it is an O(n^2) operation.

Version Information

AFSDK

Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5, 2.4
See Also
Enabling Operational Intelligence