Search Results for

    Show / Hide Table of Contents

    Class SetOrderEnumerator<T>

    A class that enumerates a collection into a given order of mutually exclusive sets

    Inheritance
    System.Object
    SetOrderEnumerator<T>
    Implements
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    System.Collections.Generic.IEnumerator<T>
    System.Collections.IEnumerator
    System.IDisposable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.Utils
    Assembly: Utils.dll
    Syntax
    public class SetOrderEnumerator<T> : IEnumerable<T>, IEnumerable, IEnumerator<T>, IEnumerator, IDisposable
    Type Parameters
    Name Description
    T

    The type of items being enumerated

    Remarks

    The sets are definied as an ordered collection of functions that return if an item of type T belongs in the set or not.

    As such an item must belong to one, and only one, set - these must be mutually exclusive sets

    For example:

    public IEnumerable<int> GetMyInts()
    {
        var myItems = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8 };
        var mySets = new List<Func<int, bool>>()
            {
                (int i) => i % 2 != 0,  //odd
                (int i) => i % 2 == 0   //even
            };
        return new SetOrderEnumerator<int>(myItems, mySets);
    }

    Will return:

    1,3,5,7,2,4,6,8

    Constructors

    SetOrderEnumerator(IEnumerable<T>, IEnumerable<Func<T, Boolean>>)

    Constructs a new SetOrderEnumerator<T> that can enumerate the given collections into ordered sets

    Declaration
    public SetOrderEnumerator(IEnumerable<T> items, IEnumerable<Func<T, bool>> sets)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> items

    The items to be enumerated

    System.Collections.Generic.IEnumerable<System.Func<T, System.Boolean>> sets

    An ordered collection of functions defining if an item of type T belongs to the set or not

    Properties

    Current

    System.Collections.Generic.IEnumerator<T>.Current Implementation. Returns current item in enumeration

    Declaration
    public T Current { get; }
    Property Value
    Type Description
    T

    Methods

    Dispose()

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    GetEnumerator()

    System.Collections.Generic.IEnumerable<T>.GetEnumerator() Implementation

    Declaration
    public IEnumerator<T> GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<T>

    An System.Collections.Generic.IEnumerator<T>

    GetMyInts()

    Declaration
    public IEnumerable<int> GetMyInts()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Int32>

    MoveNext()

    System.Collections.IEnumerator.MoveNext() Implementation. Moves to next item in the enumeration

    Declaration
    public bool MoveNext()
    Returns
    Type Description
    System.Boolean

    Reset()

    System.Collections.IEnumerator.Reset() Implementation. Resets the current enumeration

    Declaration
    public void Reset()

    Explicit Interface Implementations

    IEnumerable.GetEnumerator()

    System.Collections.IEnumerable.GetEnumerator() Implementation

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    An System.Collections.IEnumerator

    IEnumerator.Current

    System.Collections.IEnumerator.Current Implementation. The current item in the enumeration of type T

    Declaration
    object IEnumerator.Current { get; }
    Returns
    Type Description
    System.Object

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    System.Collections.Generic.IEnumerator<T>
    System.Collections.IEnumerator
    System.IDisposable

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    MiscExtensions.GetIndex<T>(IEnumerable<T>, Func<T, Boolean>)
    MiscExtensions.GetIndex(IEnumerable, Object)
    MiscExtensions.AnyItems(IEnumerable)
    MiscExtensions.CountItems(IEnumerable)
    MiscExtensions.ItemsAreEqual(IEnumerable, IEnumerable)
    MiscExtensions.ToCollectionDictionary<TKey, T>(IEnumerable<T>, Func<T, TKey>)
    MiscExtensions.ToDictionaryOfDictionary<TKey1, TKey2, T>(IEnumerable<T>, Func<T, TKey1>, Func<T, TKey2>)
    MiscExtensions.ToSizedCollections<T>(IEnumerable<T>, Int32)
    QueryExecuterHelper.FilterItems<T>(IEnumerable<T>, QueryableFilter)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToConcatenatedList(IEnumerable, Func<Object, String>, String, String, String)
    StringExtensions.ToConcatenatedList<T>(IEnumerable<T>, Func<T, String>, String, String, String)
    StringExtensions.ToConcatenatedList(IEnumerable, String, String, String)
    StringExtensions.ToConcatenatedList(IEnumerable, String)
    StringExtensions.ToCommaSeperatedList(IEnumerable, Func<Object, String>, String, String)
    StringExtensions.ToCommaSeperatedList<T>(IEnumerable<T>, Func<T, String>, String, String)
    StringExtensions.ToCommaSeperatedList(IEnumerable, String, String)
    StringExtensions.ToCommaSeperatedList(IEnumerable)
    StringExtensions.ToStringGrid<T>(IEnumerable<T>, ITreeNode<(String Name, String Key)>[], (String Name, String GroupKey)[], Func<T, String, String>, Char)
    StringExtensions.ToStringGrid<T>(IEnumerable<T>, String[], Func<T, String, String>, Char)
    StringExtensions.ToCSVFormatString(Object, Type)
    StringHelper.ToCSV(IEnumerable, String[], Type[], String[])
    SQLExtensions.ToSQLValue(Object, Boolean)
    In This Article
    Back to top © LemonTree Software Ltd. All rights reserved.