Extension methods and helper methods for IList<T>.
Extension methods that only apply to Loyc's new interfaces, or adapt a list to those interfaces, will go in LCExt instead.
The source code for adapter extension methods such as the Slice() method for arrays, which returns an ArraySlice<T> adapter, is now placed in the source file for each adapter class (e.g. ArraySlice.cs) to make it easier to create custom versions of Loyc.Essentials with parts removed.
|
static ArraySlice< T > | Slice< T > (this T[] list, int start, int length=int.MaxValue) |
|
static BufferedSequence< T > | Buffered< T > (this IList< T > source) |
|
static ListSlice< T > | Slice< T > (this IList< T > list, int start, int length=int.MaxValue) |
|
static ListSlice< T > | Slice< T > (this IListAndListSource< T > list, int start, int length=int.MaxValue) |
|
static T | TryGet< T > (this IList< T > list, int index, T defaultValue) |
|
static Maybe< T > | TryGet< T > (this IList< T > list, int index) |
|
static T | TryGet< T > (this IListAndListSource< T > list, int index, T defaultValue) |
|
static Maybe< T > | TryGet< T > (this IListAndListSource< T > list, int index) |
|
static int | BinarySearch< T > (this IList< T > list, T value) |
|
static int | BinarySearch< T > (this IList< T > list, T value, IComparer< T > pred) |
|
static int | BinarySearch< T > (this IList< T > list, T find, Comparison< T > compare) |
|
static int | BinarySearch2< T, K > (this IList< T > list, K find, Func< T, K, int > compare, bool lowerBound=true) |
|
static ? int | FinalIndexWhere< T > (this IList< T > list, Func< T, bool > pred) |
| Gets the highest index at which a condition is true, or null if nowhere. More...
|
|
static int | LastIndexWhere< T > (this IList< T > list, Func< T, bool > pred) |
| Gets the highest index at which a condition is true, or -1 if nowhere. More...
|
|
static ? int | FinalIndexWhere< T > (this IListAndListSource< T > list, Func< T, bool > pred) |
| Gets the highest index at which a condition is true, or null if nowhere. More...
|
|
static int | LastIndexWhere< T > (this IListAndListSource< T > list, Func< T, bool > pred) |
| Gets the highest index at which a condition is true, or -1 if nowhere. More...
|
|
static T[] | Randomized< T > (this IList< T > list) |
| Quickly makes a copy of a list, as an array, in random order. More...
|
|
static T[] | Randomized< T > (this IListAndListSource< T > list) |
| Quickly makes a copy of a list, as an array, in random order. More...
|
|