AlgorithmsFirstConsecutiveEqualT Method (IListT, Int32, BinaryPredicateT) |
Finds the first occurence of count consecutive "equal" items in the
list. The passed BinaryPredicate is used to determine if two items are "equal".
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static int FirstConsecutiveEqual<T>(
IList<T> list,
int count,
BinaryPredicate<T> predicate
)
public:
generic<typename T>
static int FirstConsecutiveEqual(
IList<T>^ list,
int count,
BinaryPredicate<T>^ predicate
)
Parameters
- list
- Type: System.Collections.GenericIListT
The list to examine. - count
- Type: SystemInt32
The number of consecutive equal items to look for. The count must be at least 1. - predicate
- Type: X3Platform.CollectionsBinaryPredicateT
The BinaryPredicate used to compare items for "equality".
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.FirstConsecutiveEqual``1(System.Collections.Generic.IList{``0},System.Int32,X3Platform.Collections.BinaryPredicate{``0})"]
Return Value
Type:
Int32The index of the first item in the first run of
count consecutive equal items, or -1 if no such run exists.
RemarksSince an arbitrary BinaryPredicate is passed to this function, what is being tested for need not be true equality.
See Also