161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit ArkTS
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ci/**
2261847f8eSopenharmony_ci * LinkedList is implemented based on the doubly linked list. Each node of the doubly linked list has
2361847f8eSopenharmony_ci * references pointing to the previous element and the next element. When querying an element,
2461847f8eSopenharmony_ci * the system traverses the list from the beginning or end. 
2561847f8eSopenharmony_ci *
2661847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang
2761847f8eSopenharmony_ci * @since 8
2861847f8eSopenharmony_ci */
2961847f8eSopenharmony_ci/**
3061847f8eSopenharmony_ci * LinkedList is implemented based on the doubly linked list. Each node of the doubly linked list has
3161847f8eSopenharmony_ci * references pointing to the previous element and the next element. When querying an element,
3261847f8eSopenharmony_ci * the system traverses the list from the beginning or end. 
3361847f8eSopenharmony_ci *
3461847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang
3561847f8eSopenharmony_ci * @crossplatform
3661847f8eSopenharmony_ci * @since 10
3761847f8eSopenharmony_ci */
3861847f8eSopenharmony_ci/**
3961847f8eSopenharmony_ci * LinkedList is implemented based on the doubly linked list. Each node of the doubly linked list has
4061847f8eSopenharmony_ci * references pointing to the previous element and the next element. When querying an element,
4161847f8eSopenharmony_ci * the system traverses the list from the beginning or end. 
4261847f8eSopenharmony_ci *
4361847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang
4461847f8eSopenharmony_ci * @crossplatform
4561847f8eSopenharmony_ci * @atomicservice
4661847f8eSopenharmony_ci * @since 12
4761847f8eSopenharmony_ci */
4861847f8eSopenharmony_cideclare class LinkedList<T> {
4961847f8eSopenharmony_ci  /**
5061847f8eSopenharmony_ci   * A constructor used to create a LinkedList object.
5161847f8eSopenharmony_ci   *
5261847f8eSopenharmony_ci   * @throws { BusinessError } 10200012 - The LinkedList's constructor cannot be directly invoked.
5361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
5461847f8eSopenharmony_ci   * @since 8
5561847f8eSopenharmony_ci   */
5661847f8eSopenharmony_ci  /**
5761847f8eSopenharmony_ci   * A constructor used to create a LinkedList object.
5861847f8eSopenharmony_ci   *
5961847f8eSopenharmony_ci   * @throws { BusinessError } 10200012 - The LinkedList's constructor cannot be directly invoked.
6061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
6161847f8eSopenharmony_ci   * @crossplatform
6261847f8eSopenharmony_ci   * @since 10
6361847f8eSopenharmony_ci   */
6461847f8eSopenharmony_ci  /**
6561847f8eSopenharmony_ci   * A constructor used to create a LinkedList object.
6661847f8eSopenharmony_ci   *
6761847f8eSopenharmony_ci   * @throws { BusinessError } 10200012 - The LinkedList's constructor cannot be directly invoked.
6861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
6961847f8eSopenharmony_ci   * @crossplatform
7061847f8eSopenharmony_ci   * @atomicservice
7161847f8eSopenharmony_ci   * @since 12
7261847f8eSopenharmony_ci   */
7361847f8eSopenharmony_ci  constructor();
7461847f8eSopenharmony_ci  /**
7561847f8eSopenharmony_ci   * Gets the element number of the LinkedList. This is a number one higher than the highest index in the linkedlist.
7661847f8eSopenharmony_ci   *
7761847f8eSopenharmony_ci   * @type { number }
7861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
7961847f8eSopenharmony_ci   * @since 8
8061847f8eSopenharmony_ci   */
8161847f8eSopenharmony_ci  /**
8261847f8eSopenharmony_ci   * Gets the element number of the LinkedList. This is a number one higher than the highest index in the linkedlist.
8361847f8eSopenharmony_ci   *
8461847f8eSopenharmony_ci   * @type { number }
8561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
8661847f8eSopenharmony_ci   * @crossplatform
8761847f8eSopenharmony_ci   * @since 10
8861847f8eSopenharmony_ci   */
8961847f8eSopenharmony_ci  /**
9061847f8eSopenharmony_ci   * Gets the element number of the LinkedList. This is a number one higher than the highest index in the linkedlist.
9161847f8eSopenharmony_ci   *
9261847f8eSopenharmony_ci   * @type { number }
9361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
9461847f8eSopenharmony_ci   * @crossplatform
9561847f8eSopenharmony_ci   * @atomicservice
9661847f8eSopenharmony_ci   * @since 12
9761847f8eSopenharmony_ci   */
9861847f8eSopenharmony_ci  length: number;
9961847f8eSopenharmony_ci  /**
10061847f8eSopenharmony_ci   * Appends the specified element to the end of this linkedlist.
10161847f8eSopenharmony_ci   *
10261847f8eSopenharmony_ci   * @param { T } element - element element to be appended to this linkedlist
10361847f8eSopenharmony_ci   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
10461847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The add method cannot be bound.
10561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
10661847f8eSopenharmony_ci   * @since 8
10761847f8eSopenharmony_ci   */
10861847f8eSopenharmony_ci  /**
10961847f8eSopenharmony_ci   * Appends the specified element to the end of this linkedlist.
11061847f8eSopenharmony_ci   *
11161847f8eSopenharmony_ci   * @param { T } element - element element to be appended to this linkedlist
11261847f8eSopenharmony_ci   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
11361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The add method cannot be bound.
11461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
11561847f8eSopenharmony_ci   * @crossplatform
11661847f8eSopenharmony_ci   * @since 10
11761847f8eSopenharmony_ci   */
11861847f8eSopenharmony_ci  /**
11961847f8eSopenharmony_ci   * Appends the specified element to the end of this linkedlist.
12061847f8eSopenharmony_ci   *
12161847f8eSopenharmony_ci   * @param { T } element - element element to be appended to this linkedlist
12261847f8eSopenharmony_ci   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
12361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The add method cannot be bound.
12461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
12561847f8eSopenharmony_ci   * @crossplatform
12661847f8eSopenharmony_ci   * @atomicservice
12761847f8eSopenharmony_ci   * @since 12
12861847f8eSopenharmony_ci   */
12961847f8eSopenharmony_ci  add(element: T): boolean;
13061847f8eSopenharmony_ci  /**
13161847f8eSopenharmony_ci   * Inserts the specified element at the specified position in this linkedlist.
13261847f8eSopenharmony_ci   *
13361847f8eSopenharmony_ci   * @param { number } index - index index index at which the specified element is to be inserted
13461847f8eSopenharmony_ci   * @param { T } element - element element element to be inserted
13561847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
13661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
13761847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
13861847f8eSopenharmony_ci   * 2.Incorrect parameter types;
13961847f8eSopenharmony_ci   * 3.Parameter verification failed.
14061847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
14161847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
14261847f8eSopenharmony_ci   * @since 8
14361847f8eSopenharmony_ci   */
14461847f8eSopenharmony_ci  /**
14561847f8eSopenharmony_ci   * Inserts the specified element at the specified position in this linkedlist.
14661847f8eSopenharmony_ci   *
14761847f8eSopenharmony_ci   * @param { number } index - index index index at which the specified element is to be inserted
14861847f8eSopenharmony_ci   * @param { T } element - element element element to be inserted
14961847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
15061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
15161847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
15261847f8eSopenharmony_ci   * 2.Incorrect parameter types;
15361847f8eSopenharmony_ci   * 3.Parameter verification failed.
15461847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
15561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
15661847f8eSopenharmony_ci   * @crossplatform
15761847f8eSopenharmony_ci   * @since 10
15861847f8eSopenharmony_ci   */
15961847f8eSopenharmony_ci  /**
16061847f8eSopenharmony_ci   * Inserts the specified element at the specified position in this linkedlist.
16161847f8eSopenharmony_ci   *
16261847f8eSopenharmony_ci   * @param { number } index - index index index at which the specified element is to be inserted
16361847f8eSopenharmony_ci   * @param { T } element - element element element to be inserted
16461847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
16561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
16661847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
16761847f8eSopenharmony_ci   * 2.Incorrect parameter types;
16861847f8eSopenharmony_ci   * 3.Parameter verification failed.
16961847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
17061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
17161847f8eSopenharmony_ci   * @crossplatform
17261847f8eSopenharmony_ci   * @atomicservice
17361847f8eSopenharmony_ci   * @since 12
17461847f8eSopenharmony_ci   */
17561847f8eSopenharmony_ci  insert(index: number, element: T): void;
17661847f8eSopenharmony_ci  /**
17761847f8eSopenharmony_ci   * Returns the element at the specified position in this linkedlist,
17861847f8eSopenharmony_ci   * or returns undefined if this linkedlist is empty
17961847f8eSopenharmony_ci   *
18061847f8eSopenharmony_ci   * @param { number } index - index index specified position
18161847f8eSopenharmony_ci   * @returns { T } the T type
18261847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The get method cannot be bound.
18361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
18461847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
18561847f8eSopenharmony_ci   * 2.Incorrect parameter types.
18661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
18761847f8eSopenharmony_ci   * @since 8
18861847f8eSopenharmony_ci   */
18961847f8eSopenharmony_ci  /**
19061847f8eSopenharmony_ci   * Returns the element at the specified position in this linkedlist,
19161847f8eSopenharmony_ci   * or returns undefined if this linkedlist is empty
19261847f8eSopenharmony_ci   *
19361847f8eSopenharmony_ci   * @param { number } index - index index specified position
19461847f8eSopenharmony_ci   * @returns { T } the T type
19561847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The get method cannot be bound.
19661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
19761847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
19861847f8eSopenharmony_ci   * 2.Incorrect parameter types.
19961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
20061847f8eSopenharmony_ci   * @crossplatform
20161847f8eSopenharmony_ci   * @since 10
20261847f8eSopenharmony_ci   */
20361847f8eSopenharmony_ci  /**
20461847f8eSopenharmony_ci   * Returns the element at the specified position in this linkedlist,
20561847f8eSopenharmony_ci   * or returns undefined if this linkedlist is empty
20661847f8eSopenharmony_ci   *
20761847f8eSopenharmony_ci   * @param { number } index - index index specified position
20861847f8eSopenharmony_ci   * @returns { T } the T type
20961847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The get method cannot be bound.
21061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
21161847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
21261847f8eSopenharmony_ci   * 2.Incorrect parameter types.
21361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
21461847f8eSopenharmony_ci   * @crossplatform
21561847f8eSopenharmony_ci   * @atomicservice
21661847f8eSopenharmony_ci   * @since 12
21761847f8eSopenharmony_ci   */
21861847f8eSopenharmony_ci  get(index: number): T;
21961847f8eSopenharmony_ci  /**
22061847f8eSopenharmony_ci   * Inserts the specified element at the beginning of this LinkedList.
22161847f8eSopenharmony_ci   *
22261847f8eSopenharmony_ci   * @param { T } element - element element the element to add
22361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The addFirst method cannot be bound.
22461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
22561847f8eSopenharmony_ci   * @since 8
22661847f8eSopenharmony_ci   */
22761847f8eSopenharmony_ci  /**
22861847f8eSopenharmony_ci   * Inserts the specified element at the beginning of this LinkedList.
22961847f8eSopenharmony_ci   *
23061847f8eSopenharmony_ci   * @param { T } element - element element the element to add
23161847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The addFirst method cannot be bound.
23261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
23361847f8eSopenharmony_ci   * @crossplatform
23461847f8eSopenharmony_ci   * @since 10
23561847f8eSopenharmony_ci   */
23661847f8eSopenharmony_ci  /**
23761847f8eSopenharmony_ci   * Inserts the specified element at the beginning of this LinkedList.
23861847f8eSopenharmony_ci   *
23961847f8eSopenharmony_ci   * @param { T } element - element element the element to add
24061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The addFirst method cannot be bound.
24161847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
24261847f8eSopenharmony_ci   * @crossplatform
24361847f8eSopenharmony_ci   * @atomicservice
24461847f8eSopenharmony_ci   * @since 12
24561847f8eSopenharmony_ci   */
24661847f8eSopenharmony_ci  addFirst(element: T): void;
24761847f8eSopenharmony_ci  /**
24861847f8eSopenharmony_ci   * Retrieves and removes the head (first element) of this linkedlist.
24961847f8eSopenharmony_ci   *
25061847f8eSopenharmony_ci   * @returns { T } the head of this list
25161847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeFirst method cannot be bound.
25261847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
25361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
25461847f8eSopenharmony_ci   * @since 8
25561847f8eSopenharmony_ci   */
25661847f8eSopenharmony_ci  /**
25761847f8eSopenharmony_ci   * Retrieves and removes the head (first element) of this linkedlist.
25861847f8eSopenharmony_ci   *
25961847f8eSopenharmony_ci   * @returns { T } the head of this list
26061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeFirst method cannot be bound.
26161847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
26261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
26361847f8eSopenharmony_ci   * @crossplatform
26461847f8eSopenharmony_ci   * @since 10
26561847f8eSopenharmony_ci   */
26661847f8eSopenharmony_ci  /**
26761847f8eSopenharmony_ci   * Retrieves and removes the head (first element) of this linkedlist.
26861847f8eSopenharmony_ci   *
26961847f8eSopenharmony_ci   * @returns { T } the head of this list
27061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeFirst method cannot be bound.
27161847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
27261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
27361847f8eSopenharmony_ci   * @crossplatform
27461847f8eSopenharmony_ci   * @atomicservice
27561847f8eSopenharmony_ci   * @since 12
27661847f8eSopenharmony_ci   */
27761847f8eSopenharmony_ci  removeFirst(): T;
27861847f8eSopenharmony_ci  /**
27961847f8eSopenharmony_ci   * Removes and returns the last element from this linkedlist.
28061847f8eSopenharmony_ci   *
28161847f8eSopenharmony_ci   * @returns { T } the head of this list
28261847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeLast method cannot be bound.
28361847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
28461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
28561847f8eSopenharmony_ci   * @since 8
28661847f8eSopenharmony_ci   */
28761847f8eSopenharmony_ci  /**
28861847f8eSopenharmony_ci   * Removes and returns the last element from this linkedlist.
28961847f8eSopenharmony_ci   *
29061847f8eSopenharmony_ci   * @returns { T } the head of this list
29161847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeLast method cannot be bound.
29261847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
29361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
29461847f8eSopenharmony_ci   * @crossplatform
29561847f8eSopenharmony_ci   * @since 10
29661847f8eSopenharmony_ci   */
29761847f8eSopenharmony_ci  /**
29861847f8eSopenharmony_ci   * Removes and returns the last element from this linkedlist.
29961847f8eSopenharmony_ci   *
30061847f8eSopenharmony_ci   * @returns { T } the head of this list
30161847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeLast method cannot be bound.
30261847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
30361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
30461847f8eSopenharmony_ci   * @crossplatform
30561847f8eSopenharmony_ci   * @atomicservice
30661847f8eSopenharmony_ci   * @since 12
30761847f8eSopenharmony_ci   */
30861847f8eSopenharmony_ci  removeLast(): T;
30961847f8eSopenharmony_ci  /**
31061847f8eSopenharmony_ci   * Check if linkedlist contains the specified element
31161847f8eSopenharmony_ci   *
31261847f8eSopenharmony_ci   * @param { T } element - element element element to be contained
31361847f8eSopenharmony_ci   * @returns { boolean } the boolean type,if linkedList contains the specified element,return true,else return false
31461847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The has method cannot be bound.
31561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
31661847f8eSopenharmony_ci   * @since 8
31761847f8eSopenharmony_ci   */
31861847f8eSopenharmony_ci  /**
31961847f8eSopenharmony_ci   * Check if linkedlist contains the specified element
32061847f8eSopenharmony_ci   *
32161847f8eSopenharmony_ci   * @param { T } element - element element element to be contained
32261847f8eSopenharmony_ci   * @returns { boolean } the boolean type,if linkedList contains the specified element,return true,else return false
32361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The has method cannot be bound.
32461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
32561847f8eSopenharmony_ci   * @crossplatform
32661847f8eSopenharmony_ci   * @since 10
32761847f8eSopenharmony_ci   */
32861847f8eSopenharmony_ci  /**
32961847f8eSopenharmony_ci   * Check if linkedlist contains the specified element
33061847f8eSopenharmony_ci   *
33161847f8eSopenharmony_ci   * @param { T } element - element element element to be contained
33261847f8eSopenharmony_ci   * @returns { boolean } the boolean type,if linkedList contains the specified element,return true,else return false
33361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The has method cannot be bound.
33461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
33561847f8eSopenharmony_ci   * @crossplatform
33661847f8eSopenharmony_ci   * @atomicservice
33761847f8eSopenharmony_ci   * @since 12
33861847f8eSopenharmony_ci   */
33961847f8eSopenharmony_ci  has(element: T): boolean;
34061847f8eSopenharmony_ci  /**
34161847f8eSopenharmony_ci   * Returns the index of the first occurrence of the specified element
34261847f8eSopenharmony_ci   * in this linkedlist, or -1 if this linkedlist does not contain the element.
34361847f8eSopenharmony_ci   *
34461847f8eSopenharmony_ci   * @param { T } element - element element element to be contained
34561847f8eSopenharmony_ci   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
34661847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
34761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
34861847f8eSopenharmony_ci   * @since 8
34961847f8eSopenharmony_ci   */
35061847f8eSopenharmony_ci  /**
35161847f8eSopenharmony_ci   * Returns the index of the first occurrence of the specified element
35261847f8eSopenharmony_ci   * in this linkedlist, or -1 if this linkedlist does not contain the element.
35361847f8eSopenharmony_ci   *
35461847f8eSopenharmony_ci   * @param { T } element - element element element to be contained
35561847f8eSopenharmony_ci   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
35661847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
35761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
35861847f8eSopenharmony_ci   * @crossplatform
35961847f8eSopenharmony_ci   * @since 10
36061847f8eSopenharmony_ci   */
36161847f8eSopenharmony_ci  /**
36261847f8eSopenharmony_ci   * Returns the index of the first occurrence of the specified element
36361847f8eSopenharmony_ci   * in this linkedlist, or -1 if this linkedlist does not contain the element.
36461847f8eSopenharmony_ci   *
36561847f8eSopenharmony_ci   * @param { T } element - element element element to be contained
36661847f8eSopenharmony_ci   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
36761847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
36861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
36961847f8eSopenharmony_ci   * @crossplatform
37061847f8eSopenharmony_ci   * @atomicservice
37161847f8eSopenharmony_ci   * @since 12
37261847f8eSopenharmony_ci   */
37361847f8eSopenharmony_ci  getIndexOf(element: T): number;
37461847f8eSopenharmony_ci  /**
37561847f8eSopenharmony_ci   * Find the corresponding element according to the index.
37661847f8eSopenharmony_ci   *
37761847f8eSopenharmony_ci   * @param { number } index - index index the index in the linkedlist
37861847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedlist is empty,If the index is
37961847f8eSopenharmony_ci   * out of bounds (greater than or equal to length or less than 0), throw an exception
38061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
38161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
38261847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
38361847f8eSopenharmony_ci   * 2.Incorrect parameter types;
38461847f8eSopenharmony_ci   * 3.Parameter verification failed.
38561847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
38661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
38761847f8eSopenharmony_ci   * @since 8
38861847f8eSopenharmony_ci   */
38961847f8eSopenharmony_ci  /**
39061847f8eSopenharmony_ci   * Find the corresponding element according to the index.
39161847f8eSopenharmony_ci   *
39261847f8eSopenharmony_ci   * @param { number } index - index index the index in the linkedlist
39361847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedlist is empty,If the index is
39461847f8eSopenharmony_ci   * out of bounds (greater than or equal to length or less than 0), throw an exception
39561847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
39661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
39761847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
39861847f8eSopenharmony_ci   * 2.Incorrect parameter types;
39961847f8eSopenharmony_ci   * 3.Parameter verification failed.
40061847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
40161847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
40261847f8eSopenharmony_ci   * @crossplatform
40361847f8eSopenharmony_ci   * @since 10
40461847f8eSopenharmony_ci   */
40561847f8eSopenharmony_ci  /**
40661847f8eSopenharmony_ci   * Find the corresponding element according to the index.
40761847f8eSopenharmony_ci   *
40861847f8eSopenharmony_ci   * @param { number } index - index index the index in the linkedlist
40961847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedlist is empty,If the index is
41061847f8eSopenharmony_ci   * out of bounds (greater than or equal to length or less than 0), throw an exception
41161847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
41261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
41361847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
41461847f8eSopenharmony_ci   * 2.Incorrect parameter types;
41561847f8eSopenharmony_ci   * 3.Parameter verification failed.
41661847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
41761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
41861847f8eSopenharmony_ci   * @crossplatform
41961847f8eSopenharmony_ci   * @atomicservice
42061847f8eSopenharmony_ci   * @since 12
42161847f8eSopenharmony_ci   */
42261847f8eSopenharmony_ci  removeByIndex(index: number): T;
42361847f8eSopenharmony_ci  /**
42461847f8eSopenharmony_ci   * Removes the first occurrence of the specified element from this linkedlist,
42561847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
42661847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
42761847f8eSopenharmony_ci   *
42861847f8eSopenharmony_ci   * @param { T } element - element element element to remove
42961847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
43061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
43161847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
43261847f8eSopenharmony_ci   * @since 8
43361847f8eSopenharmony_ci   */
43461847f8eSopenharmony_ci  /**
43561847f8eSopenharmony_ci   * Removes the first occurrence of the specified element from this linkedlist,
43661847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
43761847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
43861847f8eSopenharmony_ci   *
43961847f8eSopenharmony_ci   * @param { T } element - element element element to remove
44061847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
44161847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
44261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
44361847f8eSopenharmony_ci   * @crossplatform
44461847f8eSopenharmony_ci   * @since 10
44561847f8eSopenharmony_ci   */
44661847f8eSopenharmony_ci  /**
44761847f8eSopenharmony_ci   * Removes the first occurrence of the specified element from this linkedlist,
44861847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
44961847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
45061847f8eSopenharmony_ci   *
45161847f8eSopenharmony_ci   * @param { T } element - element element element to remove
45261847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
45361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
45461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
45561847f8eSopenharmony_ci   * @crossplatform
45661847f8eSopenharmony_ci   * @atomicservice
45761847f8eSopenharmony_ci   * @since 12
45861847f8eSopenharmony_ci   */
45961847f8eSopenharmony_ci  remove(element: T): boolean;
46061847f8eSopenharmony_ci  /**
46161847f8eSopenharmony_ci   * Removes the first occurrence of the specified element from this linkedlist,
46261847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
46361847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
46461847f8eSopenharmony_ci   *
46561847f8eSopenharmony_ci   * @param { T } element - element element element to remove
46661847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
46761847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeFirstFound method cannot be bound.
46861847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
46961847f8eSopenharmony_ci   * @throws { BusinessError } 10200017 - The element does not exist in this container.
47061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
47161847f8eSopenharmony_ci   * @since 8
47261847f8eSopenharmony_ci   */
47361847f8eSopenharmony_ci  /**
47461847f8eSopenharmony_ci   * Removes the first occurrence of the specified element from this linkedlist,
47561847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
47661847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
47761847f8eSopenharmony_ci   *
47861847f8eSopenharmony_ci   * @param { T } element - element element element to remove
47961847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
48061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeFirstFound method cannot be bound.
48161847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
48261847f8eSopenharmony_ci   * @throws { BusinessError } 10200017 - The element does not exist in this container.
48361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
48461847f8eSopenharmony_ci   * @crossplatform
48561847f8eSopenharmony_ci   * @since 10
48661847f8eSopenharmony_ci   */
48761847f8eSopenharmony_ci  /**
48861847f8eSopenharmony_ci   * Removes the first occurrence of the specified element from this linkedlist,
48961847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
49061847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
49161847f8eSopenharmony_ci   *
49261847f8eSopenharmony_ci   * @param { T } element - element element element to remove
49361847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
49461847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeFirstFound method cannot be bound.
49561847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
49661847f8eSopenharmony_ci   * @throws { BusinessError } 10200017 - The element does not exist in this container.
49761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
49861847f8eSopenharmony_ci   * @crossplatform
49961847f8eSopenharmony_ci   * @atomicservice
50061847f8eSopenharmony_ci   * @since 12
50161847f8eSopenharmony_ci   */
50261847f8eSopenharmony_ci  removeFirstFound(element: T): boolean;
50361847f8eSopenharmony_ci  /**
50461847f8eSopenharmony_ci   * Removes the last occurrence of the specified element from this linkedlist,
50561847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
50661847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
50761847f8eSopenharmony_ci   *
50861847f8eSopenharmony_ci   * @param { T } element - element element element to remove
50961847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
51061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeLastFound method cannot be bound.
51161847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
51261847f8eSopenharmony_ci   * @throws { BusinessError } 10200017 - The element does not exist in this container.
51361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
51461847f8eSopenharmony_ci   * @since 8
51561847f8eSopenharmony_ci   */
51661847f8eSopenharmony_ci  /**
51761847f8eSopenharmony_ci   * Removes the last occurrence of the specified element from this linkedlist,
51861847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
51961847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
52061847f8eSopenharmony_ci   *
52161847f8eSopenharmony_ci   * @param { T } element - element element element to remove
52261847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
52361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeLastFound method cannot be bound.
52461847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
52561847f8eSopenharmony_ci   * @throws { BusinessError } 10200017 - The element does not exist in this container.
52661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
52761847f8eSopenharmony_ci   * @crossplatform
52861847f8eSopenharmony_ci   * @since 10
52961847f8eSopenharmony_ci   */
53061847f8eSopenharmony_ci  /**
53161847f8eSopenharmony_ci   * Removes the last occurrence of the specified element from this linkedlist,
53261847f8eSopenharmony_ci   * if it is present.  If the linkedlist does not contain the element, it is
53361847f8eSopenharmony_ci   * unchanged.  More formally, removes the element with the lowest index
53461847f8eSopenharmony_ci   *
53561847f8eSopenharmony_ci   * @param { T } element - element element element to remove
53661847f8eSopenharmony_ci   * @returns { boolean } the boolean type ,If there is no such element, return false
53761847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The removeLastFound method cannot be bound.
53861847f8eSopenharmony_ci   * @throws { BusinessError } 10200010 - Container is empty.
53961847f8eSopenharmony_ci   * @throws { BusinessError } 10200017 - The element does not exist in this container.
54061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
54161847f8eSopenharmony_ci   * @crossplatform
54261847f8eSopenharmony_ci   * @atomicservice
54361847f8eSopenharmony_ci   * @since 12
54461847f8eSopenharmony_ci   */
54561847f8eSopenharmony_ci  removeLastFound(element: T): boolean;
54661847f8eSopenharmony_ci  /**
54761847f8eSopenharmony_ci   * Returns in the index of the last occurrence of the specified element in this linkedlist ,
54861847f8eSopenharmony_ci   * or -1 if the linkedlist does not contain the element.
54961847f8eSopenharmony_ci   *
55061847f8eSopenharmony_ci   * @param { T } element - element element element to find
55161847f8eSopenharmony_ci   * @returns { number } the number type
55261847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
55361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
55461847f8eSopenharmony_ci   * @since 8
55561847f8eSopenharmony_ci   */
55661847f8eSopenharmony_ci  /**
55761847f8eSopenharmony_ci   * Returns in the index of the last occurrence of the specified element in this linkedlist ,
55861847f8eSopenharmony_ci   * or -1 if the linkedlist does not contain the element.
55961847f8eSopenharmony_ci   *
56061847f8eSopenharmony_ci   * @param { T } element - element element element to find
56161847f8eSopenharmony_ci   * @returns { number } the number type
56261847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
56361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
56461847f8eSopenharmony_ci   * @crossplatform
56561847f8eSopenharmony_ci   * @since 10
56661847f8eSopenharmony_ci   */
56761847f8eSopenharmony_ci  /**
56861847f8eSopenharmony_ci   * Returns in the index of the last occurrence of the specified element in this linkedlist ,
56961847f8eSopenharmony_ci   * or -1 if the linkedlist does not contain the element.
57061847f8eSopenharmony_ci   *
57161847f8eSopenharmony_ci   * @param { T } element - element element element to find
57261847f8eSopenharmony_ci   * @returns { number } the number type
57361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
57461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
57561847f8eSopenharmony_ci   * @crossplatform
57661847f8eSopenharmony_ci   * @atomicservice
57761847f8eSopenharmony_ci   * @since 12
57861847f8eSopenharmony_ci   */
57961847f8eSopenharmony_ci  getLastIndexOf(element: T): number;
58061847f8eSopenharmony_ci  /**
58161847f8eSopenharmony_ci   * Returns the first element (the item at index 0) of this linkedlist.
58261847f8eSopenharmony_ci   * or returns undefined if linkedlist is empty
58361847f8eSopenharmony_ci   *
58461847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
58561847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
58661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
58761847f8eSopenharmony_ci   * @since 8
58861847f8eSopenharmony_ci   */
58961847f8eSopenharmony_ci  /**
59061847f8eSopenharmony_ci   * Returns the first element (the item at index 0) of this linkedlist.
59161847f8eSopenharmony_ci   * or returns undefined if linkedlist is empty
59261847f8eSopenharmony_ci   *
59361847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
59461847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
59561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
59661847f8eSopenharmony_ci   * @crossplatform
59761847f8eSopenharmony_ci   * @since 10
59861847f8eSopenharmony_ci   */
59961847f8eSopenharmony_ci  /**
60061847f8eSopenharmony_ci   * Returns the first element (the item at index 0) of this linkedlist.
60161847f8eSopenharmony_ci   * or returns undefined if linkedlist is empty
60261847f8eSopenharmony_ci   *
60361847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
60461847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
60561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
60661847f8eSopenharmony_ci   * @crossplatform
60761847f8eSopenharmony_ci   * @atomicservice
60861847f8eSopenharmony_ci   * @since 12
60961847f8eSopenharmony_ci   */
61061847f8eSopenharmony_ci  getFirst(): T;
61161847f8eSopenharmony_ci  /**
61261847f8eSopenharmony_ci   * Returns the Last element (the item at index length-1) of this linkedlist.
61361847f8eSopenharmony_ci   * or returns undefined if linkedlist is empty
61461847f8eSopenharmony_ci   *
61561847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
61661847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getLast method cannot be bound.
61761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
61861847f8eSopenharmony_ci   * @since 8
61961847f8eSopenharmony_ci   */
62061847f8eSopenharmony_ci  /**
62161847f8eSopenharmony_ci   * Returns the Last element (the item at index length-1) of this linkedlist.
62261847f8eSopenharmony_ci   * or returns undefined if linkedlist is empty
62361847f8eSopenharmony_ci   *
62461847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
62561847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getLast method cannot be bound.
62661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
62761847f8eSopenharmony_ci   * @crossplatform
62861847f8eSopenharmony_ci   * @since 10
62961847f8eSopenharmony_ci   */
63061847f8eSopenharmony_ci  /**
63161847f8eSopenharmony_ci   * Returns the Last element (the item at index length-1) of this linkedlist.
63261847f8eSopenharmony_ci   * or returns undefined if linkedlist is empty
63361847f8eSopenharmony_ci   *
63461847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
63561847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The getLast method cannot be bound.
63661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
63761847f8eSopenharmony_ci   * @crossplatform
63861847f8eSopenharmony_ci   * @atomicservice
63961847f8eSopenharmony_ci   * @since 12
64061847f8eSopenharmony_ci   */
64161847f8eSopenharmony_ci  getLast(): T;
64261847f8eSopenharmony_ci  /**
64361847f8eSopenharmony_ci   * Replaces the element at the specified position in this Vector with the specified element
64461847f8eSopenharmony_ci   *
64561847f8eSopenharmony_ci   * @param { number } index - index index index to find
64661847f8eSopenharmony_ci   * @param { T } element - element element replaced element
64761847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
64861847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The set method cannot be bound.
64961847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
65061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
65161847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
65261847f8eSopenharmony_ci   * 2.Incorrect parameter types;
65361847f8eSopenharmony_ci   * 3.Parameter verification failed.
65461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
65561847f8eSopenharmony_ci   * @since 8
65661847f8eSopenharmony_ci   */
65761847f8eSopenharmony_ci  /**
65861847f8eSopenharmony_ci   * Replaces the element at the specified position in this Vector with the specified element
65961847f8eSopenharmony_ci   *
66061847f8eSopenharmony_ci   * @param { number } index - index index index to find
66161847f8eSopenharmony_ci   * @param { T } element - element element replaced element
66261847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
66361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The set method cannot be bound.
66461847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
66561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
66661847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
66761847f8eSopenharmony_ci   * 2.Incorrect parameter types;
66861847f8eSopenharmony_ci   * 3.Parameter verification failed.
66961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
67061847f8eSopenharmony_ci   * @crossplatform
67161847f8eSopenharmony_ci   * @since 10
67261847f8eSopenharmony_ci   */
67361847f8eSopenharmony_ci  /**
67461847f8eSopenharmony_ci   * Replaces the element at the specified position in this Vector with the specified element
67561847f8eSopenharmony_ci   *
67661847f8eSopenharmony_ci   * @param { number } index - index index index to find
67761847f8eSopenharmony_ci   * @param { T } element - element element replaced element
67861847f8eSopenharmony_ci   * @returns { T } the T type ,returns undefined if linkedList is empty
67961847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The set method cannot be bound.
68061847f8eSopenharmony_ci   * @throws { BusinessError } 10200001 - The value of index is out of range.
68161847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
68261847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
68361847f8eSopenharmony_ci   * 2.Incorrect parameter types;
68461847f8eSopenharmony_ci   * 3.Parameter verification failed.
68561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
68661847f8eSopenharmony_ci   * @crossplatform
68761847f8eSopenharmony_ci   * @atomicservice
68861847f8eSopenharmony_ci   * @since 12
68961847f8eSopenharmony_ci   */
69061847f8eSopenharmony_ci  set(index: number, element: T): T;
69161847f8eSopenharmony_ci  /**
69261847f8eSopenharmony_ci   * Replaces each element of this linkedlist with the result of applying the operator to that element.
69361847f8eSopenharmony_ci   *
69461847f8eSopenharmony_ci   * @param { function } callbackFn - callbackFn
69561847f8eSopenharmony_ci   * callbackFn (required) A function that accepts up to three arguments.
69661847f8eSopenharmony_ci   * The function to be called for each element.
69761847f8eSopenharmony_ci   * Value (required) current element
69861847f8eSopenharmony_ci   * Index (Optional) The index value of the current element.
69961847f8eSopenharmony_ci   * LinkedList (Optional) The linkedlist object to which the current element belongs.
70061847f8eSopenharmony_ci   * @param { Object } [thisArg] - thisArg
70161847f8eSopenharmony_ci   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
70261847f8eSopenharmony_ci   * If thisArg is omitted, undefined is used as the this value.
70361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
70461847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
70561847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
70661847f8eSopenharmony_ci   * 2.Incorrect parameter types.
70761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
70861847f8eSopenharmony_ci   * @since 8
70961847f8eSopenharmony_ci   */
71061847f8eSopenharmony_ci  /**
71161847f8eSopenharmony_ci   * Replaces each element of this linkedlist with the result of applying the operator to that element.
71261847f8eSopenharmony_ci   *
71361847f8eSopenharmony_ci   * @param { function } callbackFn - callbackFn
71461847f8eSopenharmony_ci   * callbackFn (required) A function that accepts up to three arguments.
71561847f8eSopenharmony_ci   * The function to be called for each element.
71661847f8eSopenharmony_ci   * Value (required) current element
71761847f8eSopenharmony_ci   * Index (Optional) The index value of the current element.
71861847f8eSopenharmony_ci   * LinkedList (Optional) The linkedlist object to which the current element belongs.
71961847f8eSopenharmony_ci   * @param { Object } [thisArg] - thisArg
72061847f8eSopenharmony_ci   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
72161847f8eSopenharmony_ci   * If thisArg is omitted, undefined is used as the this value.
72261847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
72361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
72461847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
72561847f8eSopenharmony_ci   * 2.Incorrect parameter types.
72661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
72761847f8eSopenharmony_ci   * @crossplatform
72861847f8eSopenharmony_ci   * @since 10
72961847f8eSopenharmony_ci   */
73061847f8eSopenharmony_ci  /**
73161847f8eSopenharmony_ci   * Replaces each element of this linkedlist with the result of applying the operator to that element.
73261847f8eSopenharmony_ci   *
73361847f8eSopenharmony_ci   * @param { function } callbackFn - callbackFn
73461847f8eSopenharmony_ci   * callbackFn (required) A function that accepts up to three arguments.
73561847f8eSopenharmony_ci   * The function to be called for each element.
73661847f8eSopenharmony_ci   * Value (required) current element
73761847f8eSopenharmony_ci   * Index (Optional) The index value of the current element.
73861847f8eSopenharmony_ci   * LinkedList (Optional) The linkedlist object to which the current element belongs.
73961847f8eSopenharmony_ci   * @param { Object } [thisArg] - thisArg
74061847f8eSopenharmony_ci   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
74161847f8eSopenharmony_ci   * If thisArg is omitted, undefined is used as the this value.
74261847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
74361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Parameter error. Possible causes:
74461847f8eSopenharmony_ci   * 1.Mandatory parameters are left unspecified;
74561847f8eSopenharmony_ci   * 2.Incorrect parameter types.
74661847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
74761847f8eSopenharmony_ci   * @crossplatform
74861847f8eSopenharmony_ci   * @atomicservice
74961847f8eSopenharmony_ci   * @since 12
75061847f8eSopenharmony_ci   */
75161847f8eSopenharmony_ci  forEach(callbackFn: (value: T, index?: number, LinkedList?: LinkedList<T>) => void, thisArg?: Object): void;
75261847f8eSopenharmony_ci  /**
75361847f8eSopenharmony_ci   * Removes all of the elements from this linkedlist.The linkedlist will
75461847f8eSopenharmony_ci   * be empty after this call returns.length becomes 0
75561847f8eSopenharmony_ci   *
75661847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
75761847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
75861847f8eSopenharmony_ci   * @since 8
75961847f8eSopenharmony_ci   */
76061847f8eSopenharmony_ci  /**
76161847f8eSopenharmony_ci   * Removes all of the elements from this linkedlist.The linkedlist will
76261847f8eSopenharmony_ci   * be empty after this call returns.length becomes 0
76361847f8eSopenharmony_ci   *
76461847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
76561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
76661847f8eSopenharmony_ci   * @crossplatform
76761847f8eSopenharmony_ci   * @since 10
76861847f8eSopenharmony_ci   */
76961847f8eSopenharmony_ci  /**
77061847f8eSopenharmony_ci   * Removes all of the elements from this linkedlist.The linkedlist will
77161847f8eSopenharmony_ci   * be empty after this call returns.length becomes 0
77261847f8eSopenharmony_ci   *
77361847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
77461847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
77561847f8eSopenharmony_ci   * @crossplatform
77661847f8eSopenharmony_ci   * @atomicservice
77761847f8eSopenharmony_ci   * @since 12
77861847f8eSopenharmony_ci   */
77961847f8eSopenharmony_ci  clear(): void;
78061847f8eSopenharmony_ci  /**
78161847f8eSopenharmony_ci   * Returns a shallow copy of this instance. (The elements themselves are not copied.)
78261847f8eSopenharmony_ci   *
78361847f8eSopenharmony_ci   * @returns { LinkedList<T> } this linkedlist instance
78461847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The clone method cannot be bound.
78561847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
78661847f8eSopenharmony_ci   * @since 8
78761847f8eSopenharmony_ci   */
78861847f8eSopenharmony_ci  /**
78961847f8eSopenharmony_ci   * Returns a shallow copy of this instance. (The elements themselves are not copied.)
79061847f8eSopenharmony_ci   *
79161847f8eSopenharmony_ci   * @returns { LinkedList<T> } this linkedlist instance
79261847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The clone method cannot be bound.
79361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
79461847f8eSopenharmony_ci   * @crossplatform
79561847f8eSopenharmony_ci   * @since 10
79661847f8eSopenharmony_ci   */
79761847f8eSopenharmony_ci  /**
79861847f8eSopenharmony_ci   * Returns a shallow copy of this instance. (The elements themselves are not copied.)
79961847f8eSopenharmony_ci   *
80061847f8eSopenharmony_ci   * @returns { LinkedList<T> } this linkedlist instance
80161847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The clone method cannot be bound.
80261847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
80361847f8eSopenharmony_ci   * @crossplatform
80461847f8eSopenharmony_ci   * @atomicservice
80561847f8eSopenharmony_ci   * @since 12
80661847f8eSopenharmony_ci   */
80761847f8eSopenharmony_ci  clone(): LinkedList<T>;
80861847f8eSopenharmony_ci  /**
80961847f8eSopenharmony_ci   * convert linkedlist to array
81061847f8eSopenharmony_ci   *
81161847f8eSopenharmony_ci   * @returns { Array<T> } the Array type
81261847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
81361847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
81461847f8eSopenharmony_ci   * @since 8
81561847f8eSopenharmony_ci   */
81661847f8eSopenharmony_ci  /**
81761847f8eSopenharmony_ci   * convert linkedlist to array
81861847f8eSopenharmony_ci   *
81961847f8eSopenharmony_ci   * @returns { Array<T> } the Array type
82061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
82161847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
82261847f8eSopenharmony_ci   * @crossplatform
82361847f8eSopenharmony_ci   * @since 10
82461847f8eSopenharmony_ci   */
82561847f8eSopenharmony_ci  /**
82661847f8eSopenharmony_ci   * convert linkedlist to array
82761847f8eSopenharmony_ci   *
82861847f8eSopenharmony_ci   * @returns { Array<T> } the Array type
82961847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
83061847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
83161847f8eSopenharmony_ci   * @crossplatform
83261847f8eSopenharmony_ci   * @atomicservice
83361847f8eSopenharmony_ci   * @since 12
83461847f8eSopenharmony_ci   */
83561847f8eSopenharmony_ci  convertToArray(): Array<T>;
83661847f8eSopenharmony_ci  /**
83761847f8eSopenharmony_ci   * returns an iterator.Each item of the iterator is a Javascript Object
83861847f8eSopenharmony_ci   *
83961847f8eSopenharmony_ci   * @returns { IterableIterator<T> }
84061847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
84161847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
84261847f8eSopenharmony_ci   * @since 8
84361847f8eSopenharmony_ci   */
84461847f8eSopenharmony_ci  /**
84561847f8eSopenharmony_ci   * returns an iterator.Each item of the iterator is a Javascript Object
84661847f8eSopenharmony_ci   *
84761847f8eSopenharmony_ci   * @returns { IterableIterator<T> }
84861847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
84961847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
85061847f8eSopenharmony_ci   * @crossplatform
85161847f8eSopenharmony_ci   * @since 10
85261847f8eSopenharmony_ci   */
85361847f8eSopenharmony_ci  /**
85461847f8eSopenharmony_ci   * returns an iterator.Each item of the iterator is a Javascript Object
85561847f8eSopenharmony_ci   *
85661847f8eSopenharmony_ci   * @returns { IterableIterator<T> }
85761847f8eSopenharmony_ci   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
85861847f8eSopenharmony_ci   * @syscap SystemCapability.Utils.Lang
85961847f8eSopenharmony_ci   * @crossplatform
86061847f8eSopenharmony_ci   * @atomicservice
86161847f8eSopenharmony_ci   * @since 12
86261847f8eSopenharmony_ci   */
86361847f8eSopenharmony_ci  [Symbol.iterator](): IterableIterator<T>;
86461847f8eSopenharmony_ci}
86561847f8eSopenharmony_ci
86661847f8eSopenharmony_ciexport default LinkedList;
867