• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit ArkTS
19 */
20
21/**
22 * ArrayList is a linear data structure that is implemented based on arrays.
23 * ArrayList can dynamically adjust the capacity based on project requirements. It increases the capacity by 50% each time.
24 *
25 * @syscap SystemCapability.Utils.Lang
26 * @since 8
27 */
28/**
29 * ArrayList is a linear data structure that is implemented based on arrays.
30 * ArrayList can dynamically adjust the capacity based on project requirements. It increases the capacity by 50% each time.
31 *
32 * @syscap SystemCapability.Utils.Lang
33 * @crossplatform
34 * @since 10
35 */
36/**
37 * ArrayList is a linear data structure that is implemented based on arrays.
38 * ArrayList can dynamically adjust the capacity based on project requirements. It increases the capacity by 50% each time.
39 *
40 * @syscap SystemCapability.Utils.Lang
41 * @crossplatform
42 * @atomicservice
43 * @since 12
44 */
45declare class ArrayList<T> {
46  /**
47   * A constructor used to create a ArrayList object.
48   *
49   * @throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked.
50   * @syscap SystemCapability.Utils.Lang
51   * @since 8
52   */
53  /**
54   * A constructor used to create a ArrayList object.
55   *
56   * @throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked.
57   * @syscap SystemCapability.Utils.Lang
58   * @crossplatform
59   * @since 10
60   */
61  /**
62   * A constructor used to create a ArrayList object.
63   *
64   * @throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked.
65   * @syscap SystemCapability.Utils.Lang
66   * @crossplatform
67   * @atomicservice
68   * @since 12
69   */
70  constructor();
71  /**
72   * Gets the element number of the ArrayList.This is a number one higher than the highest index in the arraylist.
73   *
74   * @syscap SystemCapability.Utils.Lang
75   * @since 8
76   */
77  /**
78   * Gets the element number of the ArrayList.This is a number one higher than the highest index in the arraylist.
79   *
80   * @syscap SystemCapability.Utils.Lang
81   * @crossplatform
82   * @since 10
83   */
84  /**
85   * Gets the element number of the ArrayList.This is a number one higher than the highest index in the arraylist.
86   *
87   * @syscap SystemCapability.Utils.Lang
88   * @crossplatform
89   * @atomicservice
90   * @since 12
91   */
92  length: number;
93  /**
94   * Appends the specified element to the end of this arraylist.
95   *
96   * @param { T } element - element element to be appended to this arraylist
97   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
98   * @throws { BusinessError } 10200011 - The add method cannot be bound.
99   * @syscap SystemCapability.Utils.Lang
100   * @since 8
101   */
102  /**
103   * Appends the specified element to the end of this arraylist.
104   *
105   * @param { T } element - element element to be appended to this arraylist
106   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
107   * @throws { BusinessError } 10200011 - The add method cannot be bound.
108   * @syscap SystemCapability.Utils.Lang
109   * @crossplatform
110   * @since 10
111   */
112  /**
113   * Appends the specified element to the end of this arraylist.
114   *
115   * @param { T } element - element element to be appended to this arraylist
116   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
117   * @throws { BusinessError } 10200011 - The add method cannot be bound.
118   * @syscap SystemCapability.Utils.Lang
119   * @crossplatform
120   * @atomicservice
121   * @since 12
122   */
123  add(element: T): boolean;
124  /**
125   * Inserts the specified element at the specified position in this
126   * arraylist. Shifts the element currently at that position (if any) and
127   * any subsequent elements to the right (adds one to their index).
128   *
129   * @param { T } element - element element element to be inserted
130   * @param { number } index - index index at which the specified element is to be inserted
131   * @throws { BusinessError } 10200001 - The value of index is out of range.
132   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
133   * @throws { BusinessError } 401 - Parameter error. Possible causes:
134   * 1.Mandatory parameters are left unspecified;
135   * 2.Incorrect parameter types;
136   * 3.Parameter verification failed.
137   * @syscap SystemCapability.Utils.Lang
138   * @since 8
139   */
140  /**
141   * Inserts the specified element at the specified position in this
142   * arraylist. Shifts the element currently at that position (if any) and
143   * any subsequent elements to the right (adds one to their index).
144   *
145   * @param { T } element - element element element to be inserted
146   * @param { number } index - index index at which the specified element is to be inserted
147   * @throws { BusinessError } 10200001 - The value of index is out of range.
148   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
149   * @throws { BusinessError } 401 - Parameter error. Possible causes:
150   * 1.Mandatory parameters are left unspecified;
151   * 2.Incorrect parameter types;
152   * 3.Parameter verification failed.
153   * @syscap SystemCapability.Utils.Lang
154   * @crossplatform
155   * @since 10
156   */
157  /**
158   * Inserts the specified element at the specified position in this
159   * arraylist. Shifts the element currently at that position (if any) and
160   * any subsequent elements to the right (adds one to their index).
161   *
162   * @param { T } element - element element element to be inserted
163   * @param { number } index - index index at which the specified element is to be inserted
164   * @throws { BusinessError } 10200001 - The value of index is out of range.
165   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
166   * @throws { BusinessError } 401 - Parameter error. Possible causes:
167   * 1.Mandatory parameters are left unspecified;
168   * 2.Incorrect parameter types;
169   * 3.Parameter verification failed.
170   * @syscap SystemCapability.Utils.Lang
171   * @crossplatform
172   * @atomicservice
173   * @since 12
174   */
175  insert(element: T, index: number): void;
176  /**
177   * Check if arraylist contains the specified element
178   *
179   * @param { T } element - element element element to be contained
180   * @returns { boolean } the boolean type,if arraylist contains the specified element,return true,else return false
181   * @throws { BusinessError } 10200011 - The has method cannot be bound.
182   * @syscap SystemCapability.Utils.Lang
183   * @since 8
184   */
185  /**
186   * Check if arraylist contains the specified element
187   *
188   * @param { T } element - element element element to be contained
189   * @returns { boolean } the boolean type,if arraylist contains the specified element,return true,else return false
190   * @throws { BusinessError } 10200011 - The has method cannot be bound.
191   * @syscap SystemCapability.Utils.Lang
192   * @crossplatform
193   * @since 10
194   */
195  /**
196   * Check if arraylist contains the specified element
197   *
198   * @param { T } element - element element element to be contained
199   * @returns { boolean } the boolean type,if arraylist contains the specified element,return true,else return false
200   * @throws { BusinessError } 10200011 - The has method cannot be bound.
201   * @syscap SystemCapability.Utils.Lang
202   * @crossplatform
203   * @atomicservice
204   * @since 12
205   */
206  has(element: T): boolean;
207  /**
208   * Returns the index of the first occurrence of the specified element
209   * in this arraylist, or -1 if this arraylist does not contain the element.
210   *
211   * @param { T } element - element element element to be contained
212   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
213   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
214   * @syscap SystemCapability.Utils.Lang
215   * @since 8
216   */
217  /**
218   * Returns the index of the first occurrence of the specified element
219   * in this arraylist, or -1 if this arraylist does not contain the element.
220   *
221   * @param { T } element - element element element to be contained
222   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
223   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
224   * @syscap SystemCapability.Utils.Lang
225   * @crossplatform
226   * @since 10
227   */
228  /**
229   * Returns the index of the first occurrence of the specified element
230   * in this arraylist, or -1 if this arraylist does not contain the element.
231   *
232   * @param { T } element - element element element to be contained
233   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
234   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
235   * @syscap SystemCapability.Utils.Lang
236   * @crossplatform
237   * @atomicservice
238   * @since 12
239   */
240  getIndexOf(element: T): number;
241  /**
242   * Find the corresponding element according to the index,
243   * delete the element, and move the index of all elements to the right of the element forward by one.
244   *
245   * @param { number } index - index index the index in the arraylist
246   * @returns { T } the T type ,returns undefined if arraylist is empty,If the index is
247   * @throws { BusinessError } 10200001 - The value of index is out of range.
248   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
249   * @throws { BusinessError } 401 - Parameter error. Possible causes:
250   * 1.Mandatory parameters are left unspecified;
251   * 2.Incorrect parameter types;
252   * 3.Parameter verification failed.
253   * @syscap SystemCapability.Utils.Lang
254   * @since 8
255   */
256  /**
257   * Find the corresponding element according to the index,
258   * delete the element, and move the index of all elements to the right of the element forward by one.
259   *
260   * @param { number } index - index index the index in the arraylist
261   * @returns { T } the T type ,returns undefined if arraylist is empty,If the index is
262   * @throws { BusinessError } 10200001 - The value of index is out of range.
263   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
264   * @throws { BusinessError } 401 - Parameter error. Possible causes:
265   * 1.Mandatory parameters are left unspecified;
266   * 2.Incorrect parameter types;
267   * 3.Parameter verification failed.
268   * @syscap SystemCapability.Utils.Lang
269   * @crossplatform
270   * @since 10
271   */
272  /**
273   * Find the corresponding element according to the index,
274   * delete the element, and move the index of all elements to the right of the element forward by one.
275   *
276   * @param { number } index - index index the index in the arraylist
277   * @returns { T } the T type ,returns undefined if arraylist is empty,If the index is
278   * @throws { BusinessError } 10200001 - The value of index is out of range.
279   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
280   * @throws { BusinessError } 401 - Parameter error. Possible causes:
281   * 1.Mandatory parameters are left unspecified;
282   * 2.Incorrect parameter types;
283   * 3.Parameter verification failed.
284   * @syscap SystemCapability.Utils.Lang
285   * @crossplatform
286   * @atomicservice
287   * @since 12
288   */
289  removeByIndex(index: number): T;
290  /**
291   * Removes the first occurrence of the specified element from this arraylist,
292   * if it is present.  If the arraylist does not contain the element, it is
293   * unchanged.  More formally, removes the element with the lowest index
294   *
295   * @param { T } element - element element element to remove
296   * @returns { boolean } the boolean type ,If there is no such element, return false
297   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
298   * @syscap SystemCapability.Utils.Lang
299   * @since 8
300   */
301  /**
302   * Removes the first occurrence of the specified element from this arraylist,
303   * if it is present.  If the arraylist does not contain the element, it is
304   * unchanged.  More formally, removes the element with the lowest index
305   *
306   * @param { T } element - element element element to remove
307   * @returns { boolean } the boolean type ,If there is no such element, return false
308   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
309   * @syscap SystemCapability.Utils.Lang
310   * @crossplatform
311   * @since 10
312   */
313  /**
314   * Removes the first occurrence of the specified element from this arraylist,
315   * if it is present.  If the arraylist does not contain the element, it is
316   * unchanged.  More formally, removes the element with the lowest index
317   *
318   * @param { T } element - element element element to remove
319   * @returns { boolean } the boolean type ,If there is no such element, return false
320   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
321   * @syscap SystemCapability.Utils.Lang
322   * @crossplatform
323   * @atomicservice
324   * @since 12
325   */
326  remove(element: T): boolean;
327  /**
328   * Returns in the index of the last occurrence of the specified element in this arraylist ,
329   * or -1 if the arraylist does not contain the element.
330   *
331   * @param { T } element - element element element to find
332   * @returns { number } the number type
333   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
334   * @syscap SystemCapability.Utils.Lang
335   * @since 8
336   */
337  /**
338   * Returns in the index of the last occurrence of the specified element in this arraylist ,
339   * or -1 if the arraylist does not contain the element.
340   *
341   * @param { T } element - element element element to find
342   * @returns { number } the number type
343   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
344   * @syscap SystemCapability.Utils.Lang
345   * @crossplatform
346   * @since 10
347   */
348  /**
349   * Returns in the index of the last occurrence of the specified element in this arraylist ,
350   * or -1 if the arraylist does not contain the element.
351   *
352   * @param { T } element - element element element to find
353   * @returns { number } the number type
354   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
355   * @syscap SystemCapability.Utils.Lang
356   * @crossplatform
357   * @atomicservice
358   * @since 12
359   */
360  getLastIndexOf(element: T): number;
361  /**
362   * Removes from this arraylist all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive.
363   *
364   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
365   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
366   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
367   * @throws { BusinessError } 10200011 - The removeByRange method cannot be bound.
368   * @throws { BusinessError } 401 - Parameter error. Possible causes:
369   * 1.Mandatory parameters are left unspecified;
370   * 2.Incorrect parameter types;
371   * 3.Parameter verification failed.
372   * @syscap SystemCapability.Utils.Lang
373   * @since 8
374   */
375  /**
376   * Removes from this arraylist all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive.
377   *
378   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
379   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
380   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
381   * @throws { BusinessError } 10200011 - The removeByRange method cannot be bound.
382   * @throws { BusinessError } 401 - Parameter error. Possible causes:
383   * 1.Mandatory parameters are left unspecified;
384   * 2.Incorrect parameter types;
385   * 3.Parameter verification failed.
386   * @syscap SystemCapability.Utils.Lang
387   * @crossplatform
388   * @since 10
389   */
390  /**
391   * Removes from this arraylist all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive.
392   *
393   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
394   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
395   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
396   * @throws { BusinessError } 10200011 - The removeByRange method cannot be bound.
397   * @throws { BusinessError } 401 - Parameter error. Possible causes:
398   * 1.Mandatory parameters are left unspecified;
399   * 2.Incorrect parameter types;
400   * 3.Parameter verification failed.
401   * @syscap SystemCapability.Utils.Lang
402   * @crossplatform
403   * @atomicservice
404   * @since 12
405   */
406  removeByRange(fromIndex: number, toIndex: number): void;
407  /**
408   * Replaces each element of this arraylist with the result of applying the operator to that element.
409   *
410   * @param { function } callbackFn - callbackFn
411   * callbackFn (required) A function that accepts up to three arguments.
412   * The function to be called for each element.
413   * @param { Object } [thisArg] - thisArg
414   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
415   * If thisArg is omitted, undefined is used as the this value.
416   * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
417   * @throws { BusinessError } 401 - Parameter error. Possible causes:
418   * 1.Mandatory parameters are left unspecified;
419   * 2.Incorrect parameter types.
420   * @syscap SystemCapability.Utils.Lang
421   * @since 8
422   */
423  /**
424   * Replaces each element of this arraylist with the result of applying the operator to that element.
425   *
426   * @param { function } callbackFn - callbackFn
427   * callbackFn (required) A function that accepts up to three arguments.
428   * The function to be called for each element.
429   * @param { Object } [thisArg] - thisArg
430   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
431   * If thisArg is omitted, undefined is used as the this value.
432   * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
433   * @throws { BusinessError } 401 - Parameter error. Possible causes:
434   * 1.Mandatory parameters are left unspecified;
435   * 2.Incorrect parameter types.
436   * @syscap SystemCapability.Utils.Lang
437   * @crossplatform
438   * @since 10
439   */
440  /**
441   * Replaces each element of this arraylist with the result of applying the operator to that element.
442   *
443   * @param { function } callbackFn - callbackFn
444   * callbackFn (required) A function that accepts up to three arguments.
445   * The function to be called for each element.
446   * @param { Object } [thisArg] - thisArg
447   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
448   * If thisArg is omitted, undefined is used as the this value.
449   * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
450   * @throws { BusinessError } 401 - Parameter error. Possible causes:
451   * 1.Mandatory parameters are left unspecified;
452   * 2.Incorrect parameter types.
453   * @syscap SystemCapability.Utils.Lang
454   * @crossplatform
455   * @atomicservice
456   * @since 12
457   */
458  replaceAllElements(callbackFn: (value: T, index?: number, arrlist?: ArrayList<T>) => T, thisArg?: Object): void;
459  /**
460   * Executes a provided function once for each value in the arraylist object.
461   *
462   * @param { function } callbackFn - callbackFn
463   * callbackFn (required) A function that accepts up to three arguments.
464   * The function to be called for each element.
465   * @param { Object } [thisArg] - thisArg
466   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
467   * If thisArg is omitted, undefined is used as the this value.
468   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
469   * @throws { BusinessError } 401 - Parameter error. Possible causes:
470   * 1.Mandatory parameters are left unspecified;
471   * 2.Incorrect parameter types.
472   * @syscap SystemCapability.Utils.Lang
473   * @since 8
474   */
475  /**
476   * Executes a provided function once for each value in the arraylist object.
477   *
478   * @param { function } callbackFn - callbackFn
479   * callbackFn (required) A function that accepts up to three arguments.
480   * The function to be called for each element.
481   * @param { Object } [thisArg] - thisArg
482   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
483   * If thisArg is omitted, undefined is used as the this value.
484   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
485   * @throws { BusinessError } 401 - Parameter error. Possible causes:
486   * 1.Mandatory parameters are left unspecified;
487   * 2.Incorrect parameter types.
488   * @syscap SystemCapability.Utils.Lang
489   * @crossplatform
490   * @since 10
491   */
492  /**
493   * Executes a provided function once for each value in the arraylist object.
494   *
495   * @param { function } callbackFn - callbackFn
496   * callbackFn (required) A function that accepts up to three arguments.
497   * The function to be called for each element.
498   * @param { Object } [thisArg] - thisArg
499   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
500   * If thisArg is omitted, undefined is used as the this value.
501   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
502   * @throws { BusinessError } 401 - Parameter error. Possible causes:
503   * 1.Mandatory parameters are left unspecified;
504   * 2.Incorrect parameter types.
505   * @syscap SystemCapability.Utils.Lang
506   * @crossplatform
507   * @atomicservice
508   * @since 12
509   */
510  forEach(callbackFn: (value: T, index?: number, arrlist?: ArrayList<T>) => void, thisArg?: Object): void;
511  /**
512   * Sorts this arraylist according to the order induced by the specified comparator,without comparator this parameter,
513   * it will default to ASCII sorting
514   *
515   * @param { function } [comparator] - comparator
516   * comparator (Optional) A function that accepts up to two arguments.Specifies the sort order.
517   * Must be a function,return number type,If it returns firstValue minus secondValue, it returns an arraylist
518   * sorted in ascending order;If it returns secondValue minus firstValue, it returns an arraylist sorted in descending order;
519   * If this parameter is empty, it will default to ASCII sorting
520   * @throws { BusinessError } 10200011 - The sort method cannot be bound.
521   * @throws { BusinessError } 401 - Parameter error. Possible causes:
522   * 1.Incorrect parameter types;
523   * 2.Parameter verification failed.
524   * @syscap SystemCapability.Utils.Lang
525   * @since 8
526   */
527  /**
528   * Sorts this arraylist according to the order induced by the specified comparator,without comparator this parameter,
529   * it will default to ASCII sorting
530   *
531   * @param { function } [comparator] - comparator
532   * comparator (Optional) A function that accepts up to two arguments.Specifies the sort order.
533   * Must be a function,return number type,If it returns firstValue minus secondValue, it returns an arraylist
534   * sorted in ascending order;If it returns secondValue minus firstValue, it returns an arraylist sorted in descending order;
535   * If this parameter is empty, it will default to ASCII sorting
536   * @throws { BusinessError } 10200011 - The sort method cannot be bound.
537   * @throws { BusinessError } 401 - Parameter error. Possible causes:
538   * 1.Incorrect parameter types;
539   * 2.Parameter verification failed.
540   * @syscap SystemCapability.Utils.Lang
541   * @crossplatform
542   * @since 10
543   */
544  /**
545   * Sorts this arraylist according to the order induced by the specified comparator,without comparator this parameter,
546   * it will default to ASCII sorting
547   *
548   * @param { function } [comparator] - comparator
549   * comparator (Optional) A function that accepts up to two arguments.Specifies the sort order.
550   * Must be a function,return number type,If it returns firstValue minus secondValue, it returns an arraylist
551   * sorted in ascending order;If it returns secondValue minus firstValue, it returns an arraylist sorted in descending order;
552   * If this parameter is empty, it will default to ASCII sorting
553   * @throws { BusinessError } 10200011 - The sort method cannot be bound.
554   * @throws { BusinessError } 401 - Parameter error. Possible causes:
555   * 1.Incorrect parameter types;
556   * 2.Parameter verification failed.
557   * @syscap SystemCapability.Utils.Lang
558   * @crossplatform
559   * @atomicservice
560   * @since 12
561   */
562  sort(comparator?: (firstValue: T, secondValue: T) => number): void;
563  /**
564   * Returns a view of the portion of this arraylist between the specified fromIndex,inclusive,and toIndex,exclusive
565   *
566   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
567   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
568   * @returns { ArrayList<T> }
569   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
570   * @throws { BusinessError } 10200011 - The subArrayList method cannot be bound.
571   * @throws { BusinessError } 401 - Parameter error. Possible causes:
572   * 1.Mandatory parameters are left unspecified;
573   * 2.Incorrect parameter types;
574   * 3.Parameter verification failed.
575   * @syscap SystemCapability.Utils.Lang
576   * @since 8
577   */
578  /**
579   * Returns a view of the portion of this arraylist between the specified fromIndex,inclusive,and toIndex,exclusive
580   *
581   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
582   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
583   * @returns { ArrayList<T> }
584   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
585   * @throws { BusinessError } 10200011 - The subArrayList method cannot be bound.
586   * @throws { BusinessError } 401 - Parameter error. Possible causes:
587   * 1.Mandatory parameters are left unspecified;
588   * 2.Incorrect parameter types;
589   * 3.Parameter verification failed.
590   * @syscap SystemCapability.Utils.Lang
591   * @crossplatform
592   * @since 10
593   */
594  /**
595   * Returns a view of the portion of this arraylist between the specified fromIndex,inclusive,and toIndex,exclusive
596   *
597   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
598   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
599   * @returns { ArrayList<T> }
600   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
601   * @throws { BusinessError } 10200011 - The subArrayList method cannot be bound.
602   * @throws { BusinessError } 401 - Parameter error. Possible causes:
603   * 1.Mandatory parameters are left unspecified;
604   * 2.Incorrect parameter types;
605   * 3.Parameter verification failed.
606   * @syscap SystemCapability.Utils.Lang
607   * @crossplatform
608   * @atomicservice
609   * @since 12
610   */
611  subArrayList(fromIndex: number, toIndex: number): ArrayList<T>;
612  /**
613   * Removes all of the elements from this arraylist.The arraylist will
614   * be empty after this call returns.length becomes 0
615   *
616   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
617   * @syscap SystemCapability.Utils.Lang
618   * @since 8
619   */
620  /**
621   * Removes all of the elements from this arraylist.The arraylist will
622   * be empty after this call returns.length becomes 0
623   *
624   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
625   * @syscap SystemCapability.Utils.Lang
626   * @crossplatform
627   * @since 10
628   */
629  /**
630   * Removes all of the elements from this arraylist.The arraylist will
631   * be empty after this call returns.length becomes 0
632   *
633   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
634   * @syscap SystemCapability.Utils.Lang
635   * @crossplatform
636   * @atomicservice
637   * @since 12
638   */
639  clear(): void;
640  /**
641   * Returns a shallow copy of this instance. (The elements themselves are not copied.)
642   *
643   * @returns { ArrayList<T> } this arraylist instance
644   * @throws { BusinessError } 10200011 - The clone method cannot be bound.
645   * @syscap SystemCapability.Utils.Lang
646   * @since 8
647   */
648  /**
649   * Returns a shallow copy of this instance. (The elements themselves are not copied.)
650   *
651   * @returns { ArrayList<T> } this arraylist instance
652   * @throws { BusinessError } 10200011 - The clone method cannot be bound.
653   * @syscap SystemCapability.Utils.Lang
654   * @crossplatform
655   * @since 10
656   */
657  /**
658   * Returns a shallow copy of this instance. (The elements themselves are not copied.)
659   *
660   * @returns { ArrayList<T> } this arraylist instance
661   * @throws { BusinessError } 10200011 - The clone method cannot be bound.
662   * @syscap SystemCapability.Utils.Lang
663   * @crossplatform
664   * @atomicservice
665   * @since 12
666   */
667  clone(): ArrayList<T>;
668  /**
669   * returns the capacity of this arraylist
670   *
671   * @returns { number } the number type
672   * @throws { BusinessError } 10200011 - The getCapacity method cannot be bound.
673   * @syscap SystemCapability.Utils.Lang
674   * @since 8
675   */
676  /**
677   * returns the capacity of this arraylist
678   *
679   * @returns { number } the number type
680   * @throws { BusinessError } 10200011 - The getCapacity method cannot be bound.
681   * @syscap SystemCapability.Utils.Lang
682   * @crossplatform
683   * @since 10
684   */
685  /**
686   * returns the capacity of this arraylist
687   *
688   * @returns { number } the number type
689   * @throws { BusinessError } 10200011 - The getCapacity method cannot be bound.
690   * @syscap SystemCapability.Utils.Lang
691   * @crossplatform
692   * @atomicservice
693   * @since 12
694   */
695  getCapacity(): number;
696  /**
697   * convert arraylist to array
698   *
699   * @returns { Array<T> } the Array type
700   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
701   * @syscap SystemCapability.Utils.Lang
702   * @since 8
703   */
704  /**
705   * convert arraylist to array
706   *
707   * @returns { Array<T> } the Array type
708   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
709   * @syscap SystemCapability.Utils.Lang
710   * @crossplatform
711   * @since 10
712   */
713  /**
714   * convert arraylist to array
715   *
716   * @returns { Array<T> } the Array type
717   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
718   * @syscap SystemCapability.Utils.Lang
719   * @crossplatform
720   * @atomicservice
721   * @since 12
722   */
723  convertToArray(): Array<T>;
724  /**
725   * Determine whether arraylist is empty and whether there is an element
726   *
727   * @returns { boolean } the boolean type
728   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
729   * @syscap SystemCapability.Utils.Lang
730   * @since 8
731   */
732  /**
733   * Determine whether arraylist is empty and whether there is an element
734   *
735   * @returns { boolean } the boolean type
736   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
737   * @syscap SystemCapability.Utils.Lang
738   * @crossplatform
739   * @since 10
740   */
741  /**
742   * Determine whether arraylist is empty and whether there is an element
743   *
744   * @returns { boolean } the boolean type
745   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
746   * @syscap SystemCapability.Utils.Lang
747   * @crossplatform
748   * @atomicservice
749   * @since 12
750   */
751  isEmpty(): boolean;
752  /**
753   * Returns the item at that index.
754   *
755   * @param { number } index - The zero-based index of the desired code unit.
756   *     Throws error if index < 0 or index >= arraylist.length.
757   * @returns { T } The element in the arraylist matching the given index.
758   * @throws { BusinessError } 401 - Parameter error.
759   * @throws { BusinessError } 10200001 - The value of index is out of range.
760   * @syscap SystemCapability.Utils.Lang
761   * @atomicservice
762   * @since 12
763   */
764  [index: number]: T;
765  /**
766   * If the newCapacity provided by the user is greater than or equal to length,
767   * change the capacity of the arraylist to newCapacity, otherwise the capacity will not be changed
768   *
769   * @param { number } newCapacity - newCapacity newCapacity
770   * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound.
771   * @throws { BusinessError } 401 - Parameter error. Possible causes:
772   * 1.Mandatory parameters are left unspecified;
773   * 2.Incorrect parameter types.
774   * @syscap SystemCapability.Utils.Lang
775   * @since 8
776   */
777  /**
778   * If the newCapacity provided by the user is greater than or equal to length,
779   * change the capacity of the arraylist to newCapacity, otherwise the capacity will not be changed
780   *
781   * @param { number } newCapacity - newCapacity newCapacity
782   * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound.
783   * @throws { BusinessError } 401 - Parameter error. Possible causes:
784   * 1.Mandatory parameters are left unspecified;
785   * 2.Incorrect parameter types.
786   * @syscap SystemCapability.Utils.Lang
787   * @crossplatform
788   * @since 10
789   */
790  /**
791   * If the newCapacity provided by the user is greater than or equal to length,
792   * change the capacity of the arraylist to newCapacity, otherwise the capacity will not be changed
793   *
794   * @param { number } newCapacity - newCapacity newCapacity
795   * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound.
796   * @throws { BusinessError } 401 - Parameter error. Possible causes:
797   * 1.Mandatory parameters are left unspecified;
798   * 2.Incorrect parameter types.
799   * @syscap SystemCapability.Utils.Lang
800   * @crossplatform
801   * @atomicservice
802   * @since 12
803   */
804  increaseCapacityTo(newCapacity: number): void;
805  /**
806   * Limit the capacity to the current length
807   *
808   * @throws { BusinessError } 10200011 - The trimToCurrentLength method cannot be bound.
809   * @syscap SystemCapability.Utils.Lang
810   * @since 8
811   */
812  /**
813   * Limit the capacity to the current length
814   *
815   * @throws { BusinessError } 10200011 - The trimToCurrentLength method cannot be bound.
816   * @syscap SystemCapability.Utils.Lang
817   * @crossplatform
818   * @since 10
819   */
820  /**
821   * Limit the capacity to the current length
822   *
823   * @throws { BusinessError } 10200011 - The trimToCurrentLength method cannot be bound.
824   * @syscap SystemCapability.Utils.Lang
825   * @crossplatform
826   * @atomicservice
827   * @since 12
828   */
829  trimToCurrentLength(): void;
830  /**
831   * returns an iterator.Each item of the iterator is a Javascript Object
832   *
833   * @returns { IterableIterator<T> }
834   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
835   * @syscap SystemCapability.Utils.Lang
836   * @since 8
837   */
838  /**
839   * returns an iterator.Each item of the iterator is a Javascript Object
840   *
841   * @returns { IterableIterator<T> }
842   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
843   * @syscap SystemCapability.Utils.Lang
844   * @crossplatform
845   * @since 10
846   */
847  /**
848   * returns an iterator.Each item of the iterator is a Javascript Object
849   *
850   * @returns { IterableIterator<T> }
851   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
852   * @syscap SystemCapability.Utils.Lang
853   * @crossplatform
854   * @atomicservice
855   * @since 12
856   */
857  [Symbol.iterator](): IterableIterator<T>;
858}
859
860export default ArrayList;
861