Search Results for

    Show / Hide Table of Contents

    Class CircularList<T>

    ICollection<T> where every item knows the previous and the next item in collection.

    Inheritance
    object
    CircularList<T>
    Namespace: GGL.Collections
    Assembly: GGL.dll
    Syntax
    [Serializable]
    public class CircularList<T>
    Type Parameters
    Name Description
    T where every item knows the previous and the next item in collection.
    Remarks

    The last item is bind to the first one.

    Constructors

    | Edit this page View Source

    CircularList()

    Create an empty list

    Declaration
    public CircularList()
    | Edit this page View Source

    CircularList(IEnumerable<T>)

    Create a circular list from a commnon one.

    Declaration
    public CircularList(IEnumerable<T> data)
    Parameters
    Type Name Description
    IEnumerable<T> data
    | Edit this page View Source

    CircularList(int)

    Create an empty list with an initial capacity

    Declaration
    public CircularList(int capacity)
    Parameters
    Type Name Description
    int capacity where every item knows the previous and the next item in collection.

    Methods

    | Edit this page View Source

    Add(T, out ListNode<T>)

    Add item in circular list.

    Declaration
    public void Add(T item, out ListNode<T> createdListNode)
    Parameters
    Type Name Description
    T item

    Item to be added.

    ListNode<T> createdListNode

    Created node in list.

    | Edit this page View Source

    AddAfter(ListNode<T>, T)

    Add item in list right after the specified node.

    Declaration
    public ListNode<T> AddAfter(ListNode<T> listNode, T item)
    Parameters
    Type Name Description
    ListNode<T> listNode where every item knows the previous and the next item in collection.
    T item where every item knows the previous and the next item in collection.
    Returns
    Type Description
    ListNode<T> where every item knows the previous and the next item in collection.
    | Edit this page View Source

    AddBefore(ListNode<T>, T)

    Add item in list right before the specified node.

    Declaration
    public ListNode<T> AddBefore(ListNode<T> listNode, T item)
    Parameters
    Type Name Description
    ListNode<T> listNode where every item knows the previous and the next item in collection.
    T item where every item knows the previous and the next item in collection.
    Returns
    Type Description
    ListNode<T> where every item knows the previous and the next item in collection.
    | Edit this page View Source

    FindNode(T)

    Get the node of a contained item if it exists.

    Declaration
    public ListNode<T> FindNode(T item)
    Parameters
    Type Name Description
    T item
    Returns
    Type Description
    ListNode<T>
    | Edit this page View Source

    FirstNode()

    Get the first node of the list.

    Declaration
    public ListNode<T> FirstNode()
    Returns
    Type Description
    ListNode<T> where every item knows the previous and the next item in collection.
    | Edit this page View Source

    LastNode()

    Get the last node of the list.

    Declaration
    public ListNode<T> LastNode()
    Returns
    Type Description
    ListNode<T> where every item knows the previous and the next item in collection.
    | Edit this page View Source

    Remove(ListNode<T>)

    Remove a node from list

    Declaration
    public bool Remove(ListNode<T> listNode)
    Parameters
    Type Name Description
    ListNode<T> listNode where every item knows the previous and the next item in collection.
    Returns
    Type Description
    bool

    True if succeeded to remove.

    Extension Methods

    EnumerableExtensions.ForEach<T>(IEnumerable<T>, Action<T, int>)
    EnumerableExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
    EnumerableExtensions.Shuffle<T>(IEnumerable<T>)

    See Also

    ICollection
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX