import type { Collection } from './Collection'; import type { Enumeration } from './Enumeration'; import type { List } from './List'; import type { RandomAccess } from './RandomAccess'; import type { Consumer } from './function/Consumer'; import type { Cloneable } from '../../java/lang/Cloneable'; import { AbstractList } from './AbstractList'; export declare class ArrayList extends AbstractList implements List, RandomAccess, Cloneable { protected elementData: E[]; constructor(param1?: number | Collection, param2?: number); /** Copies the elements of this ArrayList into given array * @param {E[]} anArray * @returns {void} */ copyInto(anArray: E[]): void; trimToSize(): void; ensureCapacity(minCapacity: number): void; setSize(newSize: number): void; /** * Returns the length of the ArrayList * * @returns {number} */ capacity(): number; /** * Returns the length of the ArrayList * * @returns {number} */ size(): number; /** * Returns whether the ArrayList is empty * * @returns {boolean} */ isEmpty(): boolean; /** * Returns an instance of ArrayListEnumerator of this ArrayList * * @returns {ArrayListEnumerator} */ elements(): Enumeration; /** * Returns whether the ArrayList contains given element * * @param {E} e * * @returns {boolean} */ contains(e: E): boolean; /** * Checks whether the two elements are equal or not * * @param e1 the first element * @param e2 the second element * * @returns true if the elements are equal and false otherwise */ protected equalElements(e1: E, e2: E): boolean; /** * Returns the index of given element. Used with an index it starts searching for object from given position. * Returns the position of the first found element or -1 if unsuccessful * * @param {E} e * @param {number} index * @returns {number} * * compare to {@link ArrayList#lastIndexOf} */ indexOf(e: E): number; indexOf(e: E, index: number): number; /** * Returns the position of the last instance of e and if given an index from that position * on backwards. Returns position or -1 if unsuccessful * * @param {E} e * @param {number} index * @returns {number} * * compare to {@link ArrayList#indexOf} */ lastIndexOf(e: E): number; lastIndexOf(e: E, index: number): number; /** * Returns the element E from index * * @param {number} index * * @returns {E} */ elementAt(index: number): E; /** * Returns the first Element E from ArrayList * * @returns {E} */ firstElement(): E; /** * Returns the last Element E from ArrayList * * @returns {E} */ lastElement(): E; /** * Adds an element to the ArrayList in given position * * @param {E} e The new element * @param {number} index position of the new element * * @returns {void} */ setElementAt(e: E, index: number): void; /** * Removes element at given position * * @param {number} index * * @returns {void} */ removeElementAt(index: number): void; /** * Inserts an element at the given position * * @param {E} e the element * @param {number} index the position * * @returns {void} */ insertElementAt(e: E, index: number): void; /** * Appends ArrayList with given element * * @param {E} e the element * * @returns {void} */ addElement(e: E): void; /** * Removes element from ArrayList * * @param {E} e the element * * @returns {boolean} true if element is removed */ removeElement(e: E): boolean; /** * Removes all elements from ArrayList but keeps the reference to the internal array * * @returns {void} */ removeAllElements(): void; /** * Returns a clone of the current ArrayList instance. Just a copy though * * @returns {ArrayList} */ clone(): ArrayList; /** * Either returns a new Array of ArrayList elements or copies elements into given array * * @param {Array?} array the optional array * * @returns {Array} */ toArray(): Array; toArray(a: Array): Array; /** * Returns element from index * see {@link ArrayList#elementAt} * * @param {number} index * * @returns {E} */ get(index: number): E; /** * Sets element at index * see {@link ArrayList#setElementAt} * * @param {number} index * @param {E} e * * @returns {E} */ set(index: number, e: E): E; /** * Adds element by appending or position * * @param {E | number} e * * @returns {boolean | E} */ add(e: E | null): boolean; add(index: number, e: E | null): void; /** * Removes element either via element * For removing the element via index use removeElementAt instead. * * @param {E | number} e * * @returns {E | boolean} */ remove(e: E): boolean; remove(index: number): E; /** * Removes all elements from ArrayList * * @returns {void} */ clear(): void; /** * Checks if incoming Collection is part of the ArrayList * * @param {Collection} c * * @returns {boolean} */ containsAll(c: Collection): boolean; /** add a collection of elements to the ArrayList * @param {Collection} c * @returns {boolean} */ addAll(c: Collection): boolean; /** * Add a collection of elements to the ArrayList at a given position * * @param {number} index * @param {Collection} c * * @returns {boolean} */ addAll(index: number, c: Collection): boolean; protected removeRange(fromIndex: number, toIndex: number): void; /** * Adds each Element from ArrayList to Consumer * * @param {Consumer} action */ forEach(action: Consumer): void; /** * Gibt eine neue Liste mit den übergebenen Elementen zurück. * * @return die neue Liste */ static of(...elements: T[]): List; transpilerCanonicalName(): string; /** * Returns whether given string is included in list of class tree * * @param {string} name * * @returns {boolean} */ isTranspiledInstanceOf(name: string): boolean; } export declare function cast_java_util_ArrayList(obj: unknown): ArrayList; //# sourceMappingURL=ArrayList.d.ts.map