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 * LightWeightSet stores a set of values, each of which must be unique. 2361847f8eSopenharmony_ci * 2461847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 2561847f8eSopenharmony_ci * @since 8 2661847f8eSopenharmony_ci */ 2761847f8eSopenharmony_ci/** 2861847f8eSopenharmony_ci * LightWeightSet stores a set of values, each of which must be unique. 2961847f8eSopenharmony_ci * 3061847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 3161847f8eSopenharmony_ci * @crossplatform 3261847f8eSopenharmony_ci * @since 10 3361847f8eSopenharmony_ci */ 3461847f8eSopenharmony_ci/** 3561847f8eSopenharmony_ci * LightWeightSet stores a set of values, each of which must be unique. 3661847f8eSopenharmony_ci * 3761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 3861847f8eSopenharmony_ci * @crossplatform 3961847f8eSopenharmony_ci * @atomicservice 4061847f8eSopenharmony_ci * @since 12 4161847f8eSopenharmony_ci */ 4261847f8eSopenharmony_cideclare class LightWeightSet<T> { 4361847f8eSopenharmony_ci /** 4461847f8eSopenharmony_ci * A constructor used to create a LightWeightSet object. 4561847f8eSopenharmony_ci * 4661847f8eSopenharmony_ci * @throws { BusinessError } 10200012 - The LightWeightSet's constructor cannot be directly invoked. 4761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 4861847f8eSopenharmony_ci * @since 8 4961847f8eSopenharmony_ci */ 5061847f8eSopenharmony_ci /** 5161847f8eSopenharmony_ci * A constructor used to create a LightWeightSet object. 5261847f8eSopenharmony_ci * 5361847f8eSopenharmony_ci * @throws { BusinessError } 10200012 - The LightWeightSet's constructor cannot be directly invoked. 5461847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 5561847f8eSopenharmony_ci * @crossplatform 5661847f8eSopenharmony_ci * @since 10 5761847f8eSopenharmony_ci */ 5861847f8eSopenharmony_ci /** 5961847f8eSopenharmony_ci * A constructor used to create a LightWeightSet object. 6061847f8eSopenharmony_ci * 6161847f8eSopenharmony_ci * @throws { BusinessError } 10200012 - The LightWeightSet's constructor cannot be directly invoked. 6261847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 6361847f8eSopenharmony_ci * @crossplatform 6461847f8eSopenharmony_ci * @atomicservice 6561847f8eSopenharmony_ci * @since 12 6661847f8eSopenharmony_ci */ 6761847f8eSopenharmony_ci constructor(); 6861847f8eSopenharmony_ci /** 6961847f8eSopenharmony_ci * Gets the element number of the LightWeightSet. 7061847f8eSopenharmony_ci * 7161847f8eSopenharmony_ci * @type { number } 7261847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 7361847f8eSopenharmony_ci * @since 8 7461847f8eSopenharmony_ci */ 7561847f8eSopenharmony_ci /** 7661847f8eSopenharmony_ci * Gets the element number of the LightWeightSet. 7761847f8eSopenharmony_ci * 7861847f8eSopenharmony_ci * @type { number } 7961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 8061847f8eSopenharmony_ci * @crossplatform 8161847f8eSopenharmony_ci * @since 10 8261847f8eSopenharmony_ci */ 8361847f8eSopenharmony_ci /** 8461847f8eSopenharmony_ci * Gets the element number of the LightWeightSet. 8561847f8eSopenharmony_ci * 8661847f8eSopenharmony_ci * @type { number } 8761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 8861847f8eSopenharmony_ci * @crossplatform 8961847f8eSopenharmony_ci * @atomicservice 9061847f8eSopenharmony_ci * @since 12 9161847f8eSopenharmony_ci */ 9261847f8eSopenharmony_ci length: number; 9361847f8eSopenharmony_ci /** 9461847f8eSopenharmony_ci * If the set does not contain the element, the specified element is added 9561847f8eSopenharmony_ci * 9661847f8eSopenharmony_ci * @param { T } obj - obj obj Added element 9761847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there contain this element) 9861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The add method cannot be bound. 9961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 10061847f8eSopenharmony_ci * @since 8 10161847f8eSopenharmony_ci */ 10261847f8eSopenharmony_ci /** 10361847f8eSopenharmony_ci * If the set does not contain the element, the specified element is added 10461847f8eSopenharmony_ci * 10561847f8eSopenharmony_ci * @param { T } obj - obj obj Added element 10661847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there contain this element) 10761847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The add method cannot be bound. 10861847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 10961847f8eSopenharmony_ci * @crossplatform 11061847f8eSopenharmony_ci * @since 10 11161847f8eSopenharmony_ci */ 11261847f8eSopenharmony_ci /** 11361847f8eSopenharmony_ci * If the set does not contain the element, the specified element is added 11461847f8eSopenharmony_ci * 11561847f8eSopenharmony_ci * @param { T } obj - obj obj Added element 11661847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there contain this element) 11761847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The add method cannot be bound. 11861847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 11961847f8eSopenharmony_ci * @crossplatform 12061847f8eSopenharmony_ci * @atomicservice 12161847f8eSopenharmony_ci * @since 12 12261847f8eSopenharmony_ci */ 12361847f8eSopenharmony_ci add(obj: T): boolean; 12461847f8eSopenharmony_ci /** 12561847f8eSopenharmony_ci * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container 12661847f8eSopenharmony_ci * 12761847f8eSopenharmony_ci * @param { LightWeightSet<T> } set - set set the Set object to provide the added element 12861847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there any new data added successfully) 12961847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The addAll method cannot be bound. 13061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 13161847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 13261847f8eSopenharmony_ci * 2.Incorrect parameter types. 13361847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 13461847f8eSopenharmony_ci * @since 8 13561847f8eSopenharmony_ci */ 13661847f8eSopenharmony_ci /** 13761847f8eSopenharmony_ci * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container 13861847f8eSopenharmony_ci * 13961847f8eSopenharmony_ci * @param { LightWeightSet<T> } set - set set the Set object to provide the added element 14061847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there any new data added successfully) 14161847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The addAll method cannot be bound. 14261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 14361847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 14461847f8eSopenharmony_ci * 2.Incorrect parameter types. 14561847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 14661847f8eSopenharmony_ci * @crossplatform 14761847f8eSopenharmony_ci * @since 10 14861847f8eSopenharmony_ci */ 14961847f8eSopenharmony_ci /** 15061847f8eSopenharmony_ci * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container 15161847f8eSopenharmony_ci * 15261847f8eSopenharmony_ci * @param { LightWeightSet<T> } set - set set the Set object to provide the added element 15361847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there any new data added successfully) 15461847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The addAll method cannot be bound. 15561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 15661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 15761847f8eSopenharmony_ci * 2.Incorrect parameter types. 15861847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 15961847f8eSopenharmony_ci * @crossplatform 16061847f8eSopenharmony_ci * @atomicservice 16161847f8eSopenharmony_ci * @since 12 16261847f8eSopenharmony_ci */ 16361847f8eSopenharmony_ci addAll(set: LightWeightSet<T>): boolean; 16461847f8eSopenharmony_ci /** 16561847f8eSopenharmony_ci * Returns whether this set has all the object in a specified set 16661847f8eSopenharmony_ci * 16761847f8eSopenharmony_ci * @param { LightWeightSet<T> } set - set set the Set object to compare 16861847f8eSopenharmony_ci * @returns { boolean } the boolean type 16961847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. 17061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 17161847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 17261847f8eSopenharmony_ci * 2.Incorrect parameter types. 17361847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 17461847f8eSopenharmony_ci * @since 8 17561847f8eSopenharmony_ci */ 17661847f8eSopenharmony_ci /** 17761847f8eSopenharmony_ci * Returns whether this set has all the object in a specified set 17861847f8eSopenharmony_ci * 17961847f8eSopenharmony_ci * @param { LightWeightSet<T> } set - set set the Set object to compare 18061847f8eSopenharmony_ci * @returns { boolean } the boolean type 18161847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. 18261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 18361847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 18461847f8eSopenharmony_ci * 2.Incorrect parameter types. 18561847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 18661847f8eSopenharmony_ci * @crossplatform 18761847f8eSopenharmony_ci * @since 10 18861847f8eSopenharmony_ci */ 18961847f8eSopenharmony_ci /** 19061847f8eSopenharmony_ci * Returns whether this set has all the object in a specified set 19161847f8eSopenharmony_ci * 19261847f8eSopenharmony_ci * @param { LightWeightSet<T> } set - set set the Set object to compare 19361847f8eSopenharmony_ci * @returns { boolean } the boolean type 19461847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. 19561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 19661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 19761847f8eSopenharmony_ci * 2.Incorrect parameter types. 19861847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 19961847f8eSopenharmony_ci * @crossplatform 20061847f8eSopenharmony_ci * @atomicservice 20161847f8eSopenharmony_ci * @since 12 20261847f8eSopenharmony_ci */ 20361847f8eSopenharmony_ci hasAll(set: LightWeightSet<T>): boolean; 20461847f8eSopenharmony_ci /** 20561847f8eSopenharmony_ci * Checks whether an LightWeightSet container has a specified key 20661847f8eSopenharmony_ci * 20761847f8eSopenharmony_ci * @param { T } key - key key need to determine whether to include the key 20861847f8eSopenharmony_ci * @returns { boolean } the boolean type 20961847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The has method cannot be bound. 21061847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 21161847f8eSopenharmony_ci * @since 8 21261847f8eSopenharmony_ci */ 21361847f8eSopenharmony_ci /** 21461847f8eSopenharmony_ci * Checks whether an LightWeightSet container has a specified key 21561847f8eSopenharmony_ci * 21661847f8eSopenharmony_ci * @param { T } key - key key need to determine whether to include the key 21761847f8eSopenharmony_ci * @returns { boolean } the boolean type 21861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The has method cannot be bound. 21961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 22061847f8eSopenharmony_ci * @crossplatform 22161847f8eSopenharmony_ci * @since 10 22261847f8eSopenharmony_ci */ 22361847f8eSopenharmony_ci /** 22461847f8eSopenharmony_ci * Checks whether an LightWeightSet container has a specified key 22561847f8eSopenharmony_ci * 22661847f8eSopenharmony_ci * @param { T } key - key key need to determine whether to include the key 22761847f8eSopenharmony_ci * @returns { boolean } the boolean type 22861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The has method cannot be bound. 22961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 23061847f8eSopenharmony_ci * @crossplatform 23161847f8eSopenharmony_ci * @atomicservice 23261847f8eSopenharmony_ci * @since 12 23361847f8eSopenharmony_ci */ 23461847f8eSopenharmony_ci has(key: T): boolean; 23561847f8eSopenharmony_ci /** 23661847f8eSopenharmony_ci * Checks whether an the objects of an LightWeighSet container are of the same type as a specified Object LightWeightSet 23761847f8eSopenharmony_ci * 23861847f8eSopenharmony_ci * @param { Object } obj - obj obj need to determine whether to include the obj 23961847f8eSopenharmony_ci * @returns { boolean } the boolean type 24061847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The equal method cannot be bound. 24161847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 24261847f8eSopenharmony_ci * @since 8 24361847f8eSopenharmony_ci */ 24461847f8eSopenharmony_ci /** 24561847f8eSopenharmony_ci * Checks whether an the objects of an LightWeighSet container are of the same type as a specified Object LightWeightSet 24661847f8eSopenharmony_ci * 24761847f8eSopenharmony_ci * @param { Object } obj - obj obj need to determine whether to include the obj 24861847f8eSopenharmony_ci * @returns { boolean } the boolean type 24961847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The equal method cannot be bound. 25061847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 25161847f8eSopenharmony_ci * @crossplatform 25261847f8eSopenharmony_ci * @since 10 25361847f8eSopenharmony_ci * @deprecated since 12 25461847f8eSopenharmony_ci */ 25561847f8eSopenharmony_ci equal(obj: Object): boolean; 25661847f8eSopenharmony_ci /** 25761847f8eSopenharmony_ci * Ensures that the capacity of an LightWeightSet container is greater than or equal to a specified value, 25861847f8eSopenharmony_ci * and that the container has all the original objects after capacity expansion 25961847f8eSopenharmony_ci * 26061847f8eSopenharmony_ci * @param { number } minimumCapacity Minimum capacity to be reserved 26161847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. 26261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 26361847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 26461847f8eSopenharmony_ci * 2.Incorrect parameter types; 26561847f8eSopenharmony_ci * 3.Parameter verification failed. 26661847f8eSopenharmony_ci * @throws { BusinessError } 10200001 - The value of minimumCapacity is out of range. 26761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 26861847f8eSopenharmony_ci * @since 8 26961847f8eSopenharmony_ci */ 27061847f8eSopenharmony_ci /** 27161847f8eSopenharmony_ci * Ensures that the capacity of an LightWeightSet container is greater than or equal to a specified value, 27261847f8eSopenharmony_ci * and that the container has all the original objects after capacity expansion 27361847f8eSopenharmony_ci * 27461847f8eSopenharmony_ci * @param { number } minimumCapacity Minimum capacity to be reserved 27561847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. 27661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 27761847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 27861847f8eSopenharmony_ci * 2.Incorrect parameter types; 27961847f8eSopenharmony_ci * 3.Parameter verification failed. 28061847f8eSopenharmony_ci * @throws { BusinessError } 10200001 - The value of minimumCapacity is out of range. 28161847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 28261847f8eSopenharmony_ci * @crossplatform 28361847f8eSopenharmony_ci * @since 10 28461847f8eSopenharmony_ci */ 28561847f8eSopenharmony_ci /** 28661847f8eSopenharmony_ci * Ensures that the capacity of an LightWeightSet container is greater than or equal to a specified value, 28761847f8eSopenharmony_ci * and that the container has all the original objects after capacity expansion 28861847f8eSopenharmony_ci * 28961847f8eSopenharmony_ci * @param { number } minimumCapacity Minimum capacity to be reserved 29061847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. 29161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 29261847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 29361847f8eSopenharmony_ci * 2.Incorrect parameter types; 29461847f8eSopenharmony_ci * 3.Parameter verification failed. 29561847f8eSopenharmony_ci * @throws { BusinessError } 10200001 - The value of minimumCapacity is out of range. 29661847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 29761847f8eSopenharmony_ci * @crossplatform 29861847f8eSopenharmony_ci * @atomicservice 29961847f8eSopenharmony_ci * @since 12 30061847f8eSopenharmony_ci */ 30161847f8eSopenharmony_ci increaseCapacityTo(minimumCapacity: number): void; 30261847f8eSopenharmony_ci /** 30361847f8eSopenharmony_ci * Obtains the index of s key of a specified Object type in an LightWeightSet container 30461847f8eSopenharmony_ci * 30561847f8eSopenharmony_ci * @param { T } key - key key Looking for goals 30661847f8eSopenharmony_ci * @returns { number } Subscript corresponding to target 30761847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. 30861847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 30961847f8eSopenharmony_ci * @since 8 31061847f8eSopenharmony_ci */ 31161847f8eSopenharmony_ci /** 31261847f8eSopenharmony_ci * Obtains the index of s key of a specified Object type in an LightWeightSet container 31361847f8eSopenharmony_ci * 31461847f8eSopenharmony_ci * @param { T } key - key key Looking for goals 31561847f8eSopenharmony_ci * @returns { number } Subscript corresponding to target 31661847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. 31761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 31861847f8eSopenharmony_ci * @crossplatform 31961847f8eSopenharmony_ci * @since 10 32061847f8eSopenharmony_ci */ 32161847f8eSopenharmony_ci /** 32261847f8eSopenharmony_ci * Obtains the index of s key of a specified Object type in an LightWeightSet container 32361847f8eSopenharmony_ci * 32461847f8eSopenharmony_ci * @param { T } key - key key Looking for goals 32561847f8eSopenharmony_ci * @returns { number } Subscript corresponding to target 32661847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. 32761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 32861847f8eSopenharmony_ci * @crossplatform 32961847f8eSopenharmony_ci * @atomicservice 33061847f8eSopenharmony_ci * @since 12 33161847f8eSopenharmony_ci */ 33261847f8eSopenharmony_ci getIndexOf(key: T): number; 33361847f8eSopenharmony_ci /** 33461847f8eSopenharmony_ci * Deletes an object of a specified Object type from an LightWeightSet container 33561847f8eSopenharmony_ci * 33661847f8eSopenharmony_ci * @param { T } key - key key Target to be deleted 33761847f8eSopenharmony_ci * @returns { T } Target element 33861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The remove method cannot be bound. 33961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 34061847f8eSopenharmony_ci * @since 8 34161847f8eSopenharmony_ci */ 34261847f8eSopenharmony_ci /** 34361847f8eSopenharmony_ci * Deletes an object of a specified Object type from an LightWeightSet container 34461847f8eSopenharmony_ci * 34561847f8eSopenharmony_ci * @param { T } key - key key Target to be deleted 34661847f8eSopenharmony_ci * @returns { T } Target element 34761847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The remove method cannot be bound. 34861847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 34961847f8eSopenharmony_ci * @crossplatform 35061847f8eSopenharmony_ci * @since 10 35161847f8eSopenharmony_ci */ 35261847f8eSopenharmony_ci /** 35361847f8eSopenharmony_ci * Deletes an object of a specified Object type from an LightWeightSet container 35461847f8eSopenharmony_ci * 35561847f8eSopenharmony_ci * @param { T } key - key key Target to be deleted 35661847f8eSopenharmony_ci * @returns { T } Target element 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(key: T): T; 36461847f8eSopenharmony_ci /** 36561847f8eSopenharmony_ci * Deletes an object at the location identified by index from an LightWeightSet container 36661847f8eSopenharmony_ci * 36761847f8eSopenharmony_ci * @param { number } index - index index Target subscript for search 36861847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there a delete value) 36961847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. 37061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 37161847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 37261847f8eSopenharmony_ci * 2.Incorrect parameter types. 37361847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 37461847f8eSopenharmony_ci * @since 8 37561847f8eSopenharmony_ci */ 37661847f8eSopenharmony_ci /** 37761847f8eSopenharmony_ci * Deletes an object at the location identified by index from an LightWeightSet container 37861847f8eSopenharmony_ci * 37961847f8eSopenharmony_ci * @param { number } index - index index Target subscript for search 38061847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there a delete value) 38161847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. 38261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 38361847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 38461847f8eSopenharmony_ci * 2.Incorrect parameter types. 38561847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 38661847f8eSopenharmony_ci * @crossplatform 38761847f8eSopenharmony_ci * @since 10 38861847f8eSopenharmony_ci */ 38961847f8eSopenharmony_ci /** 39061847f8eSopenharmony_ci * Deletes an object at the location identified by index from an LightWeightSet container 39161847f8eSopenharmony_ci * 39261847f8eSopenharmony_ci * @param { number } index - index index Target subscript for search 39361847f8eSopenharmony_ci * @returns { boolean } the boolean type(Is there a delete value) 39461847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. 39561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 39661847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 39761847f8eSopenharmony_ci * 2.Incorrect parameter types. 39861847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 39961847f8eSopenharmony_ci * @crossplatform 40061847f8eSopenharmony_ci * @atomicservice 40161847f8eSopenharmony_ci * @since 12 40261847f8eSopenharmony_ci */ 40361847f8eSopenharmony_ci removeAt(index: number): boolean; 40461847f8eSopenharmony_ci /** 40561847f8eSopenharmony_ci * Removes all of the mapping from this map 40661847f8eSopenharmony_ci * The map will be empty after this call returns 40761847f8eSopenharmony_ci * 40861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The clear method cannot be bound. 40961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 41061847f8eSopenharmony_ci * @since 8 41161847f8eSopenharmony_ci */ 41261847f8eSopenharmony_ci /** 41361847f8eSopenharmony_ci * Removes all of the mapping from this map 41461847f8eSopenharmony_ci * The map will be empty after this call returns 41561847f8eSopenharmony_ci * 41661847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The clear method cannot be bound. 41761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 41861847f8eSopenharmony_ci * @crossplatform 41961847f8eSopenharmony_ci * @since 10 42061847f8eSopenharmony_ci */ 42161847f8eSopenharmony_ci /** 42261847f8eSopenharmony_ci * Removes all of the mapping from this map 42361847f8eSopenharmony_ci * The map will be empty after this call returns 42461847f8eSopenharmony_ci * 42561847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The clear method cannot be bound. 42661847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 42761847f8eSopenharmony_ci * @crossplatform 42861847f8eSopenharmony_ci * @atomicservice 42961847f8eSopenharmony_ci * @since 12 43061847f8eSopenharmony_ci */ 43161847f8eSopenharmony_ci clear(): void; 43261847f8eSopenharmony_ci /** 43361847f8eSopenharmony_ci * Executes the given callback function once for each real key in the map. 43461847f8eSopenharmony_ci * It does not perform functions on deleted keys. 43561847f8eSopenharmony_ci * 43661847f8eSopenharmony_ci * @param { function } callbackFn - callbackFn 43761847f8eSopenharmony_ci * callbackFn (required) A function that accepts up to three arguments. 43861847f8eSopenharmony_ci * The function to be called for each element. 43961847f8eSopenharmony_ci * @param { Object } [thisArg] - thisArg 44061847f8eSopenharmony_ci * thisArg (Optional) The value to be used as this value for when callbackFn is called. 44161847f8eSopenharmony_ci * If thisArg is omitted, undefined is used as the this value. 44261847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 44361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 44461847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 44561847f8eSopenharmony_ci * 2.Incorrect parameter types. 44661847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 44761847f8eSopenharmony_ci * @since 8 44861847f8eSopenharmony_ci */ 44961847f8eSopenharmony_ci /** 45061847f8eSopenharmony_ci * Executes the given callback function once for each real key in the map. 45161847f8eSopenharmony_ci * It does not perform functions on deleted keys. 45261847f8eSopenharmony_ci * 45361847f8eSopenharmony_ci * @param { function } callbackFn - callbackFn 45461847f8eSopenharmony_ci * callbackFn (required) A function that accepts up to three arguments. 45561847f8eSopenharmony_ci * The function to be called for each element. 45661847f8eSopenharmony_ci * @param { Object } [thisArg] - thisArg 45761847f8eSopenharmony_ci * thisArg (Optional) The value to be used as this value for when callbackFn is called. 45861847f8eSopenharmony_ci * If thisArg is omitted, undefined is used as the this value. 45961847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 46061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 46161847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 46261847f8eSopenharmony_ci * 2.Incorrect parameter types. 46361847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 46461847f8eSopenharmony_ci * @crossplatform 46561847f8eSopenharmony_ci * @since 10 46661847f8eSopenharmony_ci */ 46761847f8eSopenharmony_ci /** 46861847f8eSopenharmony_ci * Executes the given callback function once for each real key in the map. 46961847f8eSopenharmony_ci * It does not perform functions on deleted keys. 47061847f8eSopenharmony_ci * 47161847f8eSopenharmony_ci * @param { function } callbackFn - callbackFn 47261847f8eSopenharmony_ci * callbackFn (required) A function that accepts up to three arguments. 47361847f8eSopenharmony_ci * The function to be called for each element. 47461847f8eSopenharmony_ci * @param { Object } [thisArg] - thisArg 47561847f8eSopenharmony_ci * thisArg (Optional) The value to be used as this value for when callbackFn is called. 47661847f8eSopenharmony_ci * If thisArg is omitted, undefined is used as the this value. 47761847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The forEach method cannot be bound. 47861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 47961847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 48061847f8eSopenharmony_ci * 2.Incorrect parameter types. 48161847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 48261847f8eSopenharmony_ci * @crossplatform 48361847f8eSopenharmony_ci * @atomicservice 48461847f8eSopenharmony_ci * @since 12 48561847f8eSopenharmony_ci */ 48661847f8eSopenharmony_ci forEach(callbackFn: (value?: T, key?: T, set?: LightWeightSet<T>) => void, thisArg?: Object): void; 48761847f8eSopenharmony_ci /** 48861847f8eSopenharmony_ci * returns an ES6 iterator.Each item of the iterator is a Javascript Object 48961847f8eSopenharmony_ci * 49061847f8eSopenharmony_ci * @returns { IterableIterator<T> } 49161847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 49261847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 49361847f8eSopenharmony_ci * @since 8 49461847f8eSopenharmony_ci */ 49561847f8eSopenharmony_ci /** 49661847f8eSopenharmony_ci * returns an ES6 iterator.Each item of the iterator is a Javascript Object 49761847f8eSopenharmony_ci * 49861847f8eSopenharmony_ci * @returns { IterableIterator<T> } 49961847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 50061847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 50161847f8eSopenharmony_ci * @crossplatform 50261847f8eSopenharmony_ci * @since 10 50361847f8eSopenharmony_ci */ 50461847f8eSopenharmony_ci /** 50561847f8eSopenharmony_ci * returns an ES6 iterator.Each item of the iterator is a Javascript Object 50661847f8eSopenharmony_ci * 50761847f8eSopenharmony_ci * @returns { IterableIterator<T> } 50861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. 50961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 51061847f8eSopenharmony_ci * @crossplatform 51161847f8eSopenharmony_ci * @atomicservice 51261847f8eSopenharmony_ci * @since 12 51361847f8eSopenharmony_ci */ 51461847f8eSopenharmony_ci [Symbol.iterator](): IterableIterator<T>; 51561847f8eSopenharmony_ci /** 51661847f8eSopenharmony_ci * Obtains a string that contains all the keys and values in an LightWeightSet container 51761847f8eSopenharmony_ci * 51861847f8eSopenharmony_ci * @returns { String } 51961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 52061847f8eSopenharmony_ci * @since 8 52161847f8eSopenharmony_ci */ 52261847f8eSopenharmony_ci /** 52361847f8eSopenharmony_ci * Obtains a string that contains all the keys and values in an LightWeightSet container 52461847f8eSopenharmony_ci * 52561847f8eSopenharmony_ci * @returns { String } 52661847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 52761847f8eSopenharmony_ci * @crossplatform 52861847f8eSopenharmony_ci * @since 10 52961847f8eSopenharmony_ci */ 53061847f8eSopenharmony_ci /** 53161847f8eSopenharmony_ci * Obtains a string that contains all the keys and values in an LightWeightSet container 53261847f8eSopenharmony_ci * 53361847f8eSopenharmony_ci * @returns { String } 53461847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 53561847f8eSopenharmony_ci * @crossplatform 53661847f8eSopenharmony_ci * @atomicservice 53761847f8eSopenharmony_ci * @since 12 53861847f8eSopenharmony_ci */ 53961847f8eSopenharmony_ci toString(): String; 54061847f8eSopenharmony_ci /** 54161847f8eSopenharmony_ci * Obtains an Array that contains all the objects of an LightWeightSet container. 54261847f8eSopenharmony_ci * 54361847f8eSopenharmony_ci * @returns { Array<T> } 54461847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The toArray method cannot be bound. 54561847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 54661847f8eSopenharmony_ci * @since 8 54761847f8eSopenharmony_ci */ 54861847f8eSopenharmony_ci /** 54961847f8eSopenharmony_ci * Obtains an Array that contains all the objects of an LightWeightSet container. 55061847f8eSopenharmony_ci * 55161847f8eSopenharmony_ci * @returns { Array<T> } 55261847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The toArray method cannot be bound. 55361847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 55461847f8eSopenharmony_ci * @crossplatform 55561847f8eSopenharmony_ci * @since 10 55661847f8eSopenharmony_ci */ 55761847f8eSopenharmony_ci /** 55861847f8eSopenharmony_ci * Obtains an Array that contains all the objects of an LightWeightSet container. 55961847f8eSopenharmony_ci * 56061847f8eSopenharmony_ci * @returns { Array<T> } 56161847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The toArray method cannot be bound. 56261847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 56361847f8eSopenharmony_ci * @crossplatform 56461847f8eSopenharmony_ci * @atomicservice 56561847f8eSopenharmony_ci * @since 12 56661847f8eSopenharmony_ci */ 56761847f8eSopenharmony_ci toArray(): Array<T>; 56861847f8eSopenharmony_ci /** 56961847f8eSopenharmony_ci * Obtains the object at the location identified by index in an LightWeightSet container 57061847f8eSopenharmony_ci * 57161847f8eSopenharmony_ci * @param { number } index - index index Target subscript for search 57261847f8eSopenharmony_ci * @returns { T } the value of key-value pairs 57361847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. 57461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 57561847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 57661847f8eSopenharmony_ci * 2.Incorrect parameter types. 57761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 57861847f8eSopenharmony_ci * @since 8 57961847f8eSopenharmony_ci */ 58061847f8eSopenharmony_ci /** 58161847f8eSopenharmony_ci * Obtains the object at the location identified by index in an LightWeightSet container 58261847f8eSopenharmony_ci * 58361847f8eSopenharmony_ci * @param { number } index - index index Target subscript for search 58461847f8eSopenharmony_ci * @returns { T } the value of key-value pairs 58561847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. 58661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 58761847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 58861847f8eSopenharmony_ci * 2.Incorrect parameter types. 58961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 59061847f8eSopenharmony_ci * @crossplatform 59161847f8eSopenharmony_ci * @since 10 59261847f8eSopenharmony_ci */ 59361847f8eSopenharmony_ci /** 59461847f8eSopenharmony_ci * Obtains the object at the location identified by index in an LightWeightSet container 59561847f8eSopenharmony_ci * 59661847f8eSopenharmony_ci * @param { number } index - index index Target subscript for search 59761847f8eSopenharmony_ci * @returns { T } the value of key-value pairs 59861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. 59961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 60061847f8eSopenharmony_ci * 1.Mandatory parameters are left unspecified; 60161847f8eSopenharmony_ci * 2.Incorrect parameter types. 60261847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 60361847f8eSopenharmony_ci * @crossplatform 60461847f8eSopenharmony_ci * @atomicservice 60561847f8eSopenharmony_ci * @since 12 60661847f8eSopenharmony_ci */ 60761847f8eSopenharmony_ci getValueAt(index: number): T; 60861847f8eSopenharmony_ci /** 60961847f8eSopenharmony_ci * Returns a ES6 iterator of the values contained in this Set 61061847f8eSopenharmony_ci * 61161847f8eSopenharmony_ci * @returns { IterableIterator<T> } 61261847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The values method cannot be bound. 61361847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 61461847f8eSopenharmony_ci * @since 8 61561847f8eSopenharmony_ci */ 61661847f8eSopenharmony_ci /** 61761847f8eSopenharmony_ci * Returns a ES6 iterator of the values contained in this Set 61861847f8eSopenharmony_ci * 61961847f8eSopenharmony_ci * @returns { IterableIterator<T> } 62061847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The values method cannot be bound. 62161847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 62261847f8eSopenharmony_ci * @crossplatform 62361847f8eSopenharmony_ci * @since 10 62461847f8eSopenharmony_ci */ 62561847f8eSopenharmony_ci /** 62661847f8eSopenharmony_ci * Returns a ES6 iterator of the values contained in this Set 62761847f8eSopenharmony_ci * 62861847f8eSopenharmony_ci * @returns { IterableIterator<T> } 62961847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The values method cannot be bound. 63061847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 63161847f8eSopenharmony_ci * @crossplatform 63261847f8eSopenharmony_ci * @atomicservice 63361847f8eSopenharmony_ci * @since 12 63461847f8eSopenharmony_ci */ 63561847f8eSopenharmony_ci values(): IterableIterator<T>; 63661847f8eSopenharmony_ci /** 63761847f8eSopenharmony_ci * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order 63861847f8eSopenharmony_ci * 63961847f8eSopenharmony_ci * @returns { IterableIterator<[T, T]> } 64061847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The entries method cannot be bound. 64161847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 64261847f8eSopenharmony_ci * @since 8 64361847f8eSopenharmony_ci */ 64461847f8eSopenharmony_ci /** 64561847f8eSopenharmony_ci * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order 64661847f8eSopenharmony_ci * 64761847f8eSopenharmony_ci * @returns { IterableIterator<[T, T]> } 64861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The entries method cannot be bound. 64961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 65061847f8eSopenharmony_ci * @crossplatform 65161847f8eSopenharmony_ci * @since 10 65261847f8eSopenharmony_ci */ 65361847f8eSopenharmony_ci /** 65461847f8eSopenharmony_ci * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order 65561847f8eSopenharmony_ci * 65661847f8eSopenharmony_ci * @returns { IterableIterator<[T, T]> } 65761847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The entries method cannot be bound. 65861847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 65961847f8eSopenharmony_ci * @crossplatform 66061847f8eSopenharmony_ci * @atomicservice 66161847f8eSopenharmony_ci * @since 12 66261847f8eSopenharmony_ci */ 66361847f8eSopenharmony_ci entries(): IterableIterator<[T, T]>; 66461847f8eSopenharmony_ci /** 66561847f8eSopenharmony_ci * Returns whether the set object contains elements 66661847f8eSopenharmony_ci * 66761847f8eSopenharmony_ci * @returns { boolean } 66861847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. 66961847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 67061847f8eSopenharmony_ci * @since 8 67161847f8eSopenharmony_ci */ 67261847f8eSopenharmony_ci /** 67361847f8eSopenharmony_ci * Returns whether the set object contains elements 67461847f8eSopenharmony_ci * 67561847f8eSopenharmony_ci * @returns { boolean } 67661847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. 67761847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 67861847f8eSopenharmony_ci * @crossplatform 67961847f8eSopenharmony_ci * @since 10 68061847f8eSopenharmony_ci */ 68161847f8eSopenharmony_ci /** 68261847f8eSopenharmony_ci * Returns whether the set object contains elements 68361847f8eSopenharmony_ci * 68461847f8eSopenharmony_ci * @returns { boolean } 68561847f8eSopenharmony_ci * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. 68661847f8eSopenharmony_ci * @syscap SystemCapability.Utils.Lang 68761847f8eSopenharmony_ci * @crossplatform 68861847f8eSopenharmony_ci * @atomicservice 68961847f8eSopenharmony_ci * @since 12 69061847f8eSopenharmony_ci */ 69161847f8eSopenharmony_ci isEmpty(): boolean; 69261847f8eSopenharmony_ci} 69361847f8eSopenharmony_ci 69461847f8eSopenharmony_ciexport default LightWeightSet; 695