Enhanced C#
Language of your choice: library documentation
|
This interface is the counterpart to IListSource<T> for lists whose minimum index is not (necessarily) zero. More...
This interface is the counterpart to IListSource<T> for lists whose minimum index is not (necessarily) zero.
Be careful not to write a loop that relies on ICount.Count or starts at zero! You must always loop from Min to Max, like so:
Properties | |
int | Min [get] |
Returns the minimum valid index in the collection. More... | |
int | Max [get] |
Returns the maximum valid index in the collection. More... | |
Properties inherited from Loyc.Collections.IIndexed< int, T > | |
V | this[K key] [get] |
Gets the value associated with the specified key. More... | |
Public Member Functions | |
IRange< T > | Slice (int start, int count=int.MaxValue) |
Returns a sub-range of this list. More... | |
Public Member Functions inherited from Loyc.Collections.ITryGet< int, T > | |
V | TryGet (K key, out bool fail) |
Gets the item for the specified key or index, and does not throw an exception on failure. More... | |
IRange<T> Loyc.Collections.INegListSource< out out T >.Slice | ( | int | start, |
int | count = int.MaxValue |
||
) |
Returns a sub-range of this list.
|
get |
Returns the maximum valid index in the collection.
Count must equal Max-Min+1. If Count is 0, Max = Min-1
Referenced by Loyc.Syntax.LNode.Equals(), Loyc.Collections.LCInterfaces.IndexOf< T >(), Loyc.Collections.LinqToLists.Last< T >(), Loyc.Collections.LinqToLists.LastOrDefault< T >(), and Loyc.Syntax.LNodeExt.ToLNode().
|
get |
Returns the minimum valid index in the collection.
Referenced by Loyc.Syntax.LNode.Equals(), Loyc.Collections.LCInterfaces.IndexOf< T >(), Loyc.Collections.LinqToLists.Last< T >(), Loyc.Collections.LinqToLists.LastOrDefault< T >(), Loyc.Collections.NegListSlice< T >.NegListSlice(), Loyc.Collections.LinqToLists.SkipNowWhile< T >(), Loyc.Collections.LinqToLists.TakeNowWhile< T >(), Loyc.Collections.LinqToLists.ToArray< T >(), and Loyc.Syntax.LNodeExt.ToLNode().