@cute-dw/core
Version:
This TypeScript library is the main part of a more powerfull package designed for the fast WEB software development. The cornerstone of the library is the **DataStore** class, which might be useful when you need a full control of the data, but do not need
55 lines (54 loc) • 2.48 kB
TypeScript
import { AbstractList } from "./AbstractList";
import { LinkedListNode } from "./LinkedList";
import { List } from "./List";
import { Cloneable } from "../util/interface/Cloneable";
import { Collection, Element } from "./Collection";
/**
* Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null.
* In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list.
*/
export declare class ArrayList<T> extends AbstractList<T> implements Cloneable {
private readonly _elems;
private _size;
/**
* Constructs an empty list with the specified initial capacity (as number), or
* constructs a list containing the elements of the specified collection, in the order
* they are returned by the collection's iterator
* @param capacityOrCollection
*/
constructor(capacityOrCollection?: Collection<T> | Array<T> | number);
private _checkRange;
[Symbol.iterator](): IterableIterator<Element<T>>;
[Symbol.toStringTag]: string;
get size(): number;
append(value: Element<T>): boolean;
clear(): void;
clone(): ArrayList<T>;
contains(value: Element<T>): boolean;
/**
* @throws IndexOutOfBoundsException
*/
get(index: number): Element<T> | undefined;
/**
* @throws UnsupportedOperationException
*/
getNode(index: number): Readonly<LinkedListNode<T>> | null;
indexOf(value: Element<T>, fromIndex?: number): number;
insert(index: number, value: Element<T>): boolean;
lastIndexOf(value: Element<T>, fromIndex?: number): number;
remove(value: Element<T>): boolean;
removeAt(index: number): Element<T> | undefined;
removeRange(fromIndex: number, toIndex?: number): boolean;
set(index: number, value: Element<T>): Element<T> | undefined;
subList(fromIndex: number, toIndex: number): List<T>;
/**
* Increases the capacity of this ArrayList instance, if necessary, to ensure that it can hold at least the number of elements specified by the minimum capacity argument
* @param minCapacity The desired minimum capacity
*/
ensureCapacity(minCapacity: number): void;
/**
* Trims the capacity of this ArrayList instance to be the list's current size
*/
trimToSize(): void;
toArray(): Element<T>[];
}