|
ProcessQueueTBinarySearch(T) Method
|
Searches the entire sorted
ProcessQueueT, using a binary search algorithm, for an element using the
default comparer and returns the zero-based index of the element.
Namespace: GSF.CollectionsAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.218-beta+101eee949414e414795e55a6e73d88938f0177b8
Syntax public virtual int BinarySearch(
T item
)
Public Overridable Function BinarySearch (
item As T
) As Integer
public:
virtual int BinarySearch(
T item
)
abstract BinarySearch :
item : 'T -> int
override BinarySearch :
item : 'T -> int
function BinarySearch(item);
View SourceParameters
- item T
- The object to locate. The value can be null for reference types.
Return Value
Int32
The zero-based index of item in the sorted
ProcessQueueT, if item is found; otherwise, a negative number that is the
bitwise complement of the index of the next element that is larger than item or, if there is no larger element,
the bitwise complement of count.
Exceptions Exception | Condition |
---|
InvalidOperationException | The default comparer, Generic.Comparer.Default, cannot find an
implementation of the IComparable generic interface or the IComparable interface for type T. |
Remarks ProcessQueueT must be sorted in order for this function to return an accurate result.
See Also