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