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