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