Interface IKavenLinkedList<T>

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

Type Parameters

  • T

Implemented by

Properties

Count: number

Gets the number of nodes actually contained in the KavenLinkedList.

Returns

The number of nodes actually contained in the KavenLinkedList.

First: undefined | KavenLinkedListNode<T>

Gets the first node of the KavenLinkedList.

Returns

The first KavenLinkedListNode of the KavenLinkedList.

Last: undefined | KavenLinkedListNode<T>

Gets the last node of the KavenLinkedList.

Returns

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

Generated using TypeDoc