kaven-basic - v4.5.1
    Preparing search index...

    Interface IKavenLinkedList<T>

    interface IKavenLinkedList<T> {
        Count: number;
        First: undefined | KavenLinkedListNode<T>;
        Last: undefined | KavenLinkedListNode<T>;
        AddAfter(node: KavenLinkedListNode<T>, value: T): KavenLinkedListNode<T>;
        AddBefore(node: KavenLinkedListNode<T>, value: T): KavenLinkedListNode<T>;
        AddFirst(value: T): KavenLinkedListNode<T>;
        AddLast(value: T): KavenLinkedListNode<T>;
        Clear(): void;
        Contains(value: T): boolean;
        Find(value: T): undefined | KavenLinkedListNode<T>;
        FindLast(value: T): undefined | KavenLinkedListNode<T>;
        Remove(value: T): boolean;
        RemoveFirst(): void;
        RemoveLast(): void;
    }

    Type Parameters

    • T

    Implemented by

    Index

    Properties

    Count: number

    Gets the number of nodes actually contained in the KavenLinkedList.

    The number of nodes actually contained in the KavenLinkedList.

    First: undefined | KavenLinkedListNode<T>

    Gets the first node of the KavenLinkedList.

    The first KavenLinkedListNode of the KavenLinkedList.

    Last: undefined | KavenLinkedListNode<T>

    Gets the last node of the KavenLinkedList.

    The last KavenLinkedListNode of the KavenLinkedList.

    Methods

    • Adds a new node containing the specified value after the specified existing node in the KavenLinkedList.

      Parameters

      • node: KavenLinkedListNode<T>

        The KavenLinkedListNode after which to insert newNode.

      • value: T

        The value to add to the KavenLinkedList.

      Returns KavenLinkedListNode<T>

      The new KavenLinkedListNode containing value.

    • Adds a new node containing the specified value before the specified existing node in the KavenLinkedList.

      Parameters

      • node: KavenLinkedListNode<T>

        The KavenLinkedListNode before which to insert a new KavenLinkedListNode containing value.

      • value: T

        The value to add to the KavenLinkedList.

      Returns KavenLinkedListNode<T>

      The new KavenLinkedListNode containing value.

    • Adds a new node containing the specified value at the start of the KavenLinkedList.

      Parameters

      • value: T

        The value to add at the start of the KavenLinkedList.

      Returns KavenLinkedListNode<T>

      The new KavenLinkedListNode containing value.

    • Adds a new node containing the specified value at the end of the KavenLinkedList.

      Parameters

      • value: T

        The value to add at the end of the KavenLinkedList.

      Returns KavenLinkedListNode<T>

      The new KavenLinkedListNode containing value.

    • Removes all nodes from the KavenLinkedList.

      Returns void

    • Determines whether a value is in the KavenLinkedList.

      Parameters

      • value: T

        The value to locate in the KavenLinkedList.

      Returns boolean

      true if value is found in the KavenLinkedList; otherwise, false.

    • Finds the first node that contains the specified value.

      Parameters

      • value: T

        he value to locate in the KavenLinkedList.

      Returns undefined | KavenLinkedListNode<T>

      The first KavenLinkedListNode that contains the specified value, if found; otherwise, undefined.

    • Finds the last node that contains the specified value.

      Parameters

      • value: T

        The value to locate in the KavenLinkedList.

      Returns undefined | KavenLinkedListNode<T>

      The last KavenLinkedListNode that contains the specified value, if found; otherwise, undefined.

    • Removes the first occurrence of the specified value from the KavenLinkedList.

      Parameters

      • value: T

        The value to remove from the KavenLinkedList.

      Returns boolean

      true if the element containing value is successfully removed; otherwise, false. This method also returns false if value was not found in the original KavenLinkedList.

    • Removes the node at the start of the KavenLinkedList.

      Returns void

    • Removes the node at the end of the KavenLinkedList.

      Returns void