using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Loyc.Collections { /// <summary> /// Provides view of an <see cref="IListSource{T}"/> in which element [i] is a /// <see cref="NegListSource{T}"/> N such that N[0] refers to element [i] in the /// original list. See <see cref="LCExt.NegLists{T}(IListSource{T})"/> for more /// information. /// </summary> /// <seealso cref="SelectNegLists{T}"/> [Serializable] public class SelectNegListSources<T> : ListSourceBase<NegListSource<T>> { protected IListSource<T> _list; public SelectNegListSources(IListSource<T> list) { _list = list; } public IListSource<T> OriginalList { get { return _list; } } public sealed override NegListSource<T> TryGet(int index, ref bool fail) { fail = (uint)index >= (uint)_list.Count; return new NegListSource<T>(_list, index); } public sealed override int Count { get { return _list.Count; } } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)