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