Enhanced C#
Language of your choice: library documentation
|
Extension methods for Loyc Collection interfaces (such as IListSource<T>). More...
Extension methods for Loyc Collection interfaces (such as IListSource<T>).
The source code for adapter extension methods such as AsReadOnly() is now placed in the source file for each adapter class (e.g. CollectionAsReadOnly.cs) to make it easier to use parts of Loyc.Essentials rather than the entire library (other "decoupling" suggestions are welcome.)
Static Public Member Functions | |
static IListSource< T > | AsListSource< T > (this IList< T > c) |
Adapter: treats any IList{T} object as IListSource{T}. More... | |
static IListSource< T > | AsListSource< T > (this List< T > c) |
Adapter: treats List{T} as IListSource<T>. More... | |
static IListSource< T > | AsListSource< T > (this T[] c) |
Adapter: treats T[] as IListSource<T>. More... | |
static IListSource< T > | AsListSource< T > (this IListAndListSource< T > c) |
No-op. More... | |
static IList< T > | AsList< T > (this IListSource< T > c) |
Converts any IListSource{T} object to a read-only IList{T}. More... | |
static ListSourceAsSparse< T > | AsSparse< T > (this IListSource< T > list) |
Treats a non-sparse list as a read-only sparse list with no empty spaces. More... | |
static ISparseListSource< T > | AsSparse< T > (this ISparseListSource< T > list) |
Returns list itself. This overload exists to prevent you from accidentally wrapping a sparse list in ListSourceAsSparse<T>, which would block access to knowledge of any empty spaces in the list. More... | |
static NegListSlice< T > | Slice< T > (this INegListSource< T > list, int start, int count=int.MaxValue) |
static NegListSource< T > | AsNegList< T > (this IListSource< T > list, int zeroOffset) |
static IListSource< T > | AsListSource< T > (this IReadOnlyList< T > c) |
Adapter: treats any IReadOnlyList{T} object as IListSource{T}. More... | |
static IListSource< T > | AsListSource< T > (this IListSource< T > c) |
No-op. More... | |
static ICollection< T > | AsCollection< T > (this IReadOnlyCollection< T > c) |
Adapter: treats any IReadOnlyCollection{T} as a read-only ICollection{T}. More... | |
static IReadOnlyCollection< TResult > | UpCast< T, TResult > (this IReadOnlyCollection< T > source) |
static IListSource< TResult > | UpCast< T, TResult > (this IListSource< T > source) |
static string | Join (this System.Collections.IEnumerable list, string separator) |
|
inlinestatic |
Adapter: treats any IReadOnlyCollection{T} as a read-only ICollection{T}.
This method is named "AsCollection" and not "ToCollection" because, in contrast to methods like ToArray() and ToList(), it does not make a copy of the sequence, although it does create a new wrapper object.
|
inlinestatic |
Converts any IListSource{T} object to a read-only IList{T}.
This method is named "AsList" and not "ToList" because because, in contrast to methods like ToArray(), it does not make a copy of the sequence, although it does create a new wrapper object if c
does not implement IList<T>.
|
inlinestatic |
Adapter: treats any IList{T} object as IListSource{T}.
This method is named "AsListSource" and not "ToListSource" because, in contrast to methods like ToArray() and ToList(), it does not make a copy of the sequence.
|
static |
No-op.
|
static |
No-op.
|
inlinestatic |
Adapter: treats any IReadOnlyList{T} object as IListSource{T}.
This method is named "AsListSource" and not "ToListSource" because, in contrast to methods like ToArray() and ToList(), it does not make a copy of the sequence.
|
static |
Adapter: treats List{T} as IListSource<T>.
|
static |
Adapter: treats T[] as IListSource<T>.
|
inlinestatic |
Treats a non-sparse list as a read-only sparse list with no empty spaces.
|
inlinestatic |
Returns list
itself. This overload exists to prevent you from accidentally wrapping a sparse list in ListSourceAsSparse<T>, which would block access to knowledge of any empty spaces in the list.