/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Basic] /src/libs/interface/IKavenLinkedList.ts * @create: 2025-07-01 17:40:18.165 * @modify: 2025-07-11 21:19:12.863 * @version: 6.0.0 * @times: 4 * @lines: 129 * @copyright: Copyright © 2018-2025 Kaven. All Rights Reserved. * @description: [description] * @license: * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************/ import { KavenLinkedListNode } from "../class/KavenLinkedListNode"; export interface IKavenLinkedList { /** * Gets the last node of the KavenLinkedList. * @returns The last KavenLinkedListNode of the KavenLinkedList. */ Last: KavenLinkedListNode | undefined; /** * Gets the first node of the KavenLinkedList. * @returns The first KavenLinkedListNode of the KavenLinkedList. */ First: KavenLinkedListNode | undefined; /** * Gets the number of nodes actually contained in the KavenLinkedList. * @returns The number of nodes actually contained in the KavenLinkedList. */ Count: number; /** * Adds a new node containing the specified value after the specified existing node in the KavenLinkedList. * @param node The KavenLinkedListNode after which to insert newNode. * @param value The value to add to the KavenLinkedList. * @returns The new KavenLinkedListNode containing value. */ AddAfter(node: KavenLinkedListNode, value: T): KavenLinkedListNode; /** * Adds a new node containing the specified value before the specified existing node in the KavenLinkedList. * @param node The KavenLinkedListNode before which to insert a new KavenLinkedListNode containing value. * @param value The value to add to the KavenLinkedList. * @returns The new KavenLinkedListNode containing value. */ AddBefore(node: KavenLinkedListNode, value: T): KavenLinkedListNode; /** * Adds a new node containing the specified value at the start of the KavenLinkedList. * @param value The value to add at the start of the KavenLinkedList. * @returns The new KavenLinkedListNode containing value. */ AddFirst(value: T): KavenLinkedListNode; /** * Adds a new node containing the specified value at the end of the KavenLinkedList. * @param value The value to add at the end of the KavenLinkedList. * @returns The new KavenLinkedListNode containing value. */ AddLast(value: T): KavenLinkedListNode; /** * Removes all nodes from the KavenLinkedList. */ Clear(): void; /** * Determines whether a value is in the KavenLinkedList. * @param value The value to locate in the KavenLinkedList. * @returns true if value is found in the KavenLinkedList; otherwise, false. */ Contains(value: T): boolean; /** * Finds the first node that contains the specified value. * @param value he value to locate in the KavenLinkedList. * @returns The first KavenLinkedListNode that contains the specified value, if found; otherwise, undefined. */ Find(value: T): KavenLinkedListNode | undefined; /** * Finds the last node that contains the specified value. * @param value The value to locate in the KavenLinkedList. * @returns The last KavenLinkedListNode that contains the specified value, if found; otherwise, undefined. */ FindLast(value: T): KavenLinkedListNode | undefined; /** * Removes the first occurrence of the specified value from the KavenLinkedList. * @param value The value to remove from the KavenLinkedList. * @returns 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. */ Remove(value: T): boolean; /** * Removes the node at the start of the KavenLinkedList. */ RemoveFirst(): void; /** * Removes the node at the end of the KavenLinkedList. */ RemoveLast(): void; } //# sourceMappingURL=IKavenLinkedList.d.ts.map