public static Maybe <T> TryGet <T>(this IListAndListSource <T> list, int index) { return(((IList <T>)list).TryGet(index)); }
public Les2Parser(IListAndListSource <Token> tokens, ISourceFile file, IMessageSink messageSink) : this((IList <Token>)tokens, file, messageSink) { }
public static ListSlice <T> Slice <T>(this IListAndListSource <T> list, NumRange <int, MathI> range) { return(new ListSlice <T>(list, range.Lo, range.Count)); }
// *** Reminder: do not edit the generated output! *** // Avoid ambiguity errors involving collections that support the ambiguity-avoidance interfaces public static SelectListSource <IListSource <T>, T, TResult> Select <T, TResult>(this IListAndListSource <T> source, Func <T, TResult> selector) { return(new SelectListSource <IListSource <T>, T, TResult>(source, selector)); }
public static bool SequenceEqual <TSource>(this IListAndListSource <TSource> first, IListAndListSource <TSource> second) { return(((IList <TSource>)first).Count == ((IList <TSource>)second).Count && Enumerable.SequenceEqual(first, second)); }
public static T[] ToArray <T>(this IListAndListSource <T> c) => MutableListExtensionMethods.LinqToLists.ToArray(c);
// https://github.com/qwertie/ecsharp/issues/84 describes the problem solved by these methods // *** Reminder: do not edit the generated output! *** public static T Last <T>(this IListAndListSource <T> list) => Last((IList <T>)list);
public static int BinarySearch2 <T, K>(this IListAndListSource <T> list, K value, Func <T, K, int> compare, bool lowerBound = true) { return(BinarySearch2 <T, K>((IReadOnlyList <T>)list, value, compare, lowerBound)); }
public static T TryGet <T>(this IListAndListSource <T> list, int index, T defaultValue) { return(((IList <T>)list).TryGet(index, defaultValue)); }
public static int BinarySearch <T>(this IListAndListSource <T> list, T value, IComparer <T> comparer) { return(BinarySearch <T>((IReadOnlyList <T>)list, value, G.ToComparison(comparer))); }
public static int BinarySearch <T>(this IListAndListSource <T> list, T value, Comparison <T> compare) { return(BinarySearch <T>((IReadOnlyList <T>)list, value, compare)); }
public static int BinarySearch <T>(this IListAndListSource <T> list, T value) where T : IComparable <T> { return(BinarySearch <T>((IReadOnlyList <T>)list, value, G.ToComparison <T>())); }
/// <summary>Returns a reversed view of a list.</summary> /// <remarks>This was originally named <c>ReverseView</c>. Changed to <c>Reverse</c> to match Linq's <c>Reverse(IEnumerable)</c>.</remarks> public static ReversedList <T> Reverse <T>(this IListAndListSource <T> list) // exists to avoid an ambiguity error for collections that offer both IList<T> and IListSource<T> { return(new ReversedList <T>(list)); }
public static SelectNegLists <T> NegLists <T>(this IListAndListSource <T> source) { return(new SelectNegLists <T>(source)); }
// *** Reminder: do not edit the generated output! *** /// <summary>Skips the specified number of elements immediately and /// returns a slice of part of the list that remains, or an empty /// slice if <c>start</c> is greater than or equal to the <c>list.Count</c>.</summary> public static ListSlice <T> Skip <T>(this IListAndListSource <T> list, int start) { return(new ListSlice <T>(list, start)); }
/// <summary>Gets the highest index at which a condition is true, or -1 if nowhere.</summary> public static int LastIndexWhere <T>(this IListAndListSource <T> list, Func <T, bool> pred) { return(LCInterfaces.LastIndexWhere(list, pred)); }
/// <summary>Returns a slice of the specified number of elements from /// the beginning of the list, or a slice of the entire list if <c>count</c> /// is greater than or equal to the <c>list.Count</c>.</summary> public static ListSlice <T> Take <T>(this IListAndListSource <T> list, int count) { return(new ListSlice <T>(list, 0, count)); }
/// <summary>Quickly makes a copy of a list, as an array, in random order.</summary> public static T[] Randomized <T>(this IListAndListSource <T> list) { return(((IList <T>)list).Randomized()); }
public static ReversedList <T> Reverse <T>(this IListAndListSource <T> list) => new ReversedList <T>(list);
/// <summary>Maps a list to an array of the same length.</summary> public static R[] SelectArray <T, R>(this IListAndListSource <T> input, Func <T, R> selector) { return(SelectArray((IListSource <T>)input, selector)); }
public static T FirstOrDefault <T>(this IListAndListSource <T> list, T defaultValue = default(T)) => FirstOrDefault((IList <T>)list, defaultValue);
public static int InsertRange <T>(this IList <T> list, int index, IListAndListSource <T> source) { return(InsertRange(list, index, ((ICollection <T>)source).Count, source)); }
public static ListSlice <T> SkipNowWhile <T>(this IListAndListSource <T> list, Func <T, bool> predicate) { return(SkipNowWhile((IList <T>)list, predicate)); }
public static T LastOrDefault <T>(this IListAndListSource <T> list, T defaultValue = default(T)) { return(LastOrDefault((IList <T>)list, defaultValue)); }
// *** Reminder: do not edit the generated output! *** public static T Last <T>(this IListAndListSource <T> list) { return(Last((IListSource <T>)list)); }
public static T[] ToArray <T>(this IListAndListSource <T> c) { return(ToArray((IReadOnlyList <T>)c)); }
public static ListSlice <T> Slice <T>(this IListAndListSource <T> list, int start, int length = int.MaxValue) { return(new ListSlice <T>(list, start, length)); }
// *** Reminder: do not edit the generated output! *** /// <summary>Returns an editable reversed view of a list.</summary> /// <remarks>This was originally named <c>ReverseView</c>. Changed to <c>Reverse</c> to match Linq's <c>Reverse(IEnumerable)</c>.</remarks> public static ReversedList <T> Reverse <T>(this IListAndListSource <T> list) { return(new ReversedList <T>(list)); }
public static DList <T> ToDList <T>(this IListAndListSource <T> c) // disambiguator { return(ToDList((IReadOnlyCollection <T>)c)); }
/// <inheritdoc cref="NegList{T}.NegList"/> public static NegList <T> NegView <T>(this IListAndListSource <T> list, int zeroOffset) { return(new NegList <T>(list, zeroOffset)); }