Enhanced C#
Language of your choice: library documentation
Properties | Public Member Functions | List of all members
Loyc.Collections.INegListSource< out out T > Interface Template Reference

This interface is the counterpart to IListSource<T> for lists whose minimum index is not (necessarily) zero. More...


Source file:
Inheritance diagram for Loyc.Collections.INegListSource< out out T >:
Loyc.Collections.ITryGet< int, T > Loyc.Collections.IIndexed< int, T >

Remarks

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:

for (int i = list.Min; i <= list.Max; i++) { ... }

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 >
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 >
TryGet (K key, out bool fail)
 Gets the item for the specified key or index, and does not throw an exception on failure. More...
 

Member Function Documentation

◆ Slice()

IRange<T> Loyc.Collections.INegListSource< out out T >.Slice ( int  start,
int  count = int.MaxValue 
)

Returns a sub-range of this list.

Property Documentation

◆ Max

int Loyc.Collections.INegListSource< out out T >.Max
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().

◆ Min

int Loyc.Collections.INegListSource< out out T >.Min
get