示例#1
0
 public static Maybe <T> TryGet <T>(this IListAndListSource <T> list, int index)
 {
     return(((IList <T>)list).TryGet(index));
 }
示例#2
0
 public Les2Parser(IListAndListSource <Token> tokens, ISourceFile file, IMessageSink messageSink) : this((IList <Token>)tokens, file, messageSink)
 {
 }
示例#3
0
 public static ListSlice <T> Slice <T>(this IListAndListSource <T> list, NumRange <int, MathI> range)
 {
     return(new ListSlice <T>(list, range.Lo, range.Count));
 }
示例#4
0
 // *** 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));
 }
示例#5
0
 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));
 }
示例#6
0
 public static T[] ToArray <T>(this IListAndListSource <T> c) => MutableListExtensionMethods.LinqToLists.ToArray(c);
示例#7
0
 // 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);
示例#8
0
 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));
 }
示例#9
0
 public static T TryGet <T>(this IListAndListSource <T> list, int index, T defaultValue)
 {
     return(((IList <T>)list).TryGet(index, defaultValue));
 }
示例#10
0
 public static int BinarySearch <T>(this IListAndListSource <T> list, T value, IComparer <T> comparer)
 {
     return(BinarySearch <T>((IReadOnlyList <T>)list, value, G.ToComparison(comparer)));
 }
示例#11
0
 public static int BinarySearch <T>(this IListAndListSource <T> list, T value, Comparison <T> compare)
 {
     return(BinarySearch <T>((IReadOnlyList <T>)list, value, compare));
 }
示例#12
0
 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>()));
 }
示例#13
0
 /// <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));
 }
示例#14
0
 public static SelectNegLists <T> NegLists <T>(this IListAndListSource <T> source)
 {
     return(new SelectNegLists <T>(source));
 }
示例#15
0
 // *** 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));
 }
示例#16
0
 /// <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));
 }
示例#17
0
 /// <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));
 }
示例#18
0
 /// <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());
 }
示例#19
0
 public static ReversedList <T> Reverse <T>(this IListAndListSource <T> list) => new ReversedList <T>(list);
示例#20
0
 /// <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));
 }
示例#21
0
 public static T FirstOrDefault <T>(this IListAndListSource <T> list, T defaultValue = default(T)) =>
 FirstOrDefault((IList <T>)list, defaultValue);
示例#22
0
 public static int InsertRange <T>(this IList <T> list, int index, IListAndListSource <T> source)
 {
     return(InsertRange(list, index, ((ICollection <T>)source).Count, source));
 }
示例#23
0
 public static ListSlice <T> SkipNowWhile <T>(this IListAndListSource <T> list, Func <T, bool> predicate)
 {
     return(SkipNowWhile((IList <T>)list, predicate));
 }
示例#24
0
 public static T LastOrDefault <T>(this IListAndListSource <T> list, T defaultValue = default(T))
 {
     return(LastOrDefault((IList <T>)list, defaultValue));
 }
示例#25
0
 // *** Reminder: do not edit the generated output! ***
 public static T Last <T>(this IListAndListSource <T> list)
 {
     return(Last((IListSource <T>)list));
 }
示例#26
0
 public static T[] ToArray <T>(this IListAndListSource <T> c)
 {
     return(ToArray((IReadOnlyList <T>)c));
 }
示例#27
0
 public static ListSlice <T> Slice <T>(this IListAndListSource <T> list, int start, int length = int.MaxValue)
 {
     return(new ListSlice <T>(list, start, length));
 }
示例#28
0
 // *** 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));
 }
示例#29
0
 public static DList <T> ToDList <T>(this IListAndListSource <T> c)      // disambiguator
 {
     return(ToDList((IReadOnlyCollection <T>)c));
 }
示例#30
0
 /// <inheritdoc cref="NegList{T}.NegList"/>
 public static NegList <T> NegView <T>(this IListAndListSource <T> list, int zeroOffset)
 {
     return(new NegList <T>(list, zeroOffset));
 }