Show / Hide Table of Contents

    Class Stacks

    Functions for working with stacks.

    Inheritance
    System.Object
    Stacks
    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: Virtlink.Utilib.Collections
    Assembly: Virtlink.Utilib.dll
    Syntax
    public static class Stacks

    Methods

    | Improve this Doc View Source

    PeekOrDefault<T>(Stack<T>)

    Returns the top element of the stack without removing it; or returns the default value when the stack is empty.

    Declaration
    public static T PeekOrDefault<T>(this Stack<T> stack)
    Parameters
    Type Name Description
    System.Collections.Generic.Stack<T> stack

    The stack.

    Returns
    Type Description
    T

    The top element of the stack; or the default value of T.

    Type Parameters
    Name Description
    T

    The type of elements.

    | Improve this Doc View Source

    PushRange<T>(Stack<T>, IEnumerable<T>)

    Pushes a range of elements onto the stack.

    Declaration
    public static void PushRange<T>(this Stack<T> stack, IEnumerable<T> elements)
    Parameters
    Type Name Description
    System.Collections.Generic.Stack<T> stack

    The stack.

    System.Collections.Generic.IEnumerable<T> elements

    The elements to push.

    Type Parameters
    Name Description
    T

    The type of elements.

    Remarks

    The first element is pushed first.

    • Improve this Doc
    • View Source
    Back to top Copyright - Daniel Pelsmaeker