-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Expand file tree
/
Copy pathIIListProvider.cs
More file actions
33 lines (29 loc) · 1.22 KB
/
IIListProvider.cs
File metadata and controls
33 lines (29 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
namespace System.Linq
{
/// <summary>
/// An iterator that can produce an array or <see cref="List{TElement}"/> through an optimized path.
/// </summary>
internal interface IIListProvider<TElement> : IEnumerable<TElement>
{
/// <summary>
/// Produce an array of the sequence through an optimized path.
/// </summary>
/// <returns>The array.</returns>
TElement[] ToArray();
/// <summary>
/// Produce a <see cref="List{TElement}"/> of the sequence through an optimized path.
/// </summary>
/// <returns>The <see cref="List{TElement}"/>.</returns>
List<TElement> ToList();
/// <summary>
/// Returns the count of elements in the sequence.
/// </summary>
/// <param name="onlyIfCheap">If true then the count should only be calculated if doing
/// so is quick (sure or likely to be constant time), otherwise -1 should be returned.</param>
/// <returns>The number of elements.</returns>
int GetCount(bool onlyIfCheap);
}
}