Enhanced C#
Language of your choice: library documentation
|
Adapter: a random-access range for a slice of an IListSource<T>. More...
Adapter: a random-access range for a slice of an IListSource<T>.
T | Item type in the list |
This type was supposed to be called simply Slice
, but this was not allowed because in plain C#, "CS0542: member names cannot be the same as
their enclosing type" and of course, this type contains the Slice() method from IListSource.
Public fields | |
IListSource< T > | _list |
int | _start |
int | _count |
Public static fields | |
static readonly Slice_< T > | Empty = new Slice_<T>() |
Properties | |
int | Count [get] |
bool | IsEmpty [get] |
T | First [get] |
T | Last [get] |
T | this[int index] [get] |
T? | this[int index, T defaultValue] [get] |
Properties inherited from Loyc.Collections.IIsEmpty | |
bool | IsEmpty [get] |
Public Member Functions | |
Slice_ (IListSource< T > list, int start, int count=int.MaxValue) | |
Initializes a slice. More... | |
Slice_ (IListSource< T > list) | |
T | PopFirst (out bool empty) |
T | PopLast (out bool empty) |
IFRange< T > ICloneable< IFRange< T > >. | Clone () |
IBRange< T > ICloneable< IBRange< T > >. | Clone () |
IRange< T > ICloneable< IRange< T > >. | Clone () |
Slice_< T > | Clone () |
IEnumerator< T > IEnumerable< T >. | GetEnumerator () |
System.Collections.IEnumerator System.Collections.IEnumerable. | GetEnumerator () |
RangeEnumerator< Slice_< T >, T > | GetEnumerator () |
T | TryGet (int index, out bool fail) |
IRange< T > IListSource< T >. | Slice (int start, int count) |
Slice_< T > | Slice (int start, int count=int.MaxValue) |
|
inline |
Initializes a slice.
ArgumentException | The start index was below zero. |
The (start, count) range is allowed to be invalid, as long as 'start' and 'count' are zero or above.
list.Count - start
.