chenyc
2025-12-09 65e034683b28d799e73c7d7e5e4769fab5b9bc9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import SequentialContainer from './Base';
import { initContainer, IteratorType } from "../ContainerBase";
import { RandomIterator } from "./Base/RandomIterator";
declare class VectorIterator<T> extends RandomIterator<T> {
    container: Vector<T>;
    constructor(node: number, container: Vector<T>, iteratorType?: IteratorType);
    copy(): VectorIterator<T>;
    equals(iter: VectorIterator<T>): boolean;
}
export type { VectorIterator };
declare class Vector<T> extends SequentialContainer<T> {
    /**
     * @param container - Initialize container, must have a forEach function.
     * @param copy - When the container is an array, you can choose to directly operate on the original object of
     *               the array or perform a shallow copy. The default is shallow copy.
     */
    constructor(container?: initContainer<T>, copy?: boolean);
    clear(): void;
    begin(): VectorIterator<T>;
    end(): VectorIterator<T>;
    rBegin(): VectorIterator<T>;
    rEnd(): VectorIterator<T>;
    front(): T | undefined;
    back(): T | undefined;
    getElementByPos(pos: number): T;
    eraseElementByPos(pos: number): number;
    eraseElementByValue(value: T): number;
    eraseElementByIterator(iter: VectorIterator<T>): VectorIterator<T>;
    pushBack(element: T): number;
    popBack(): T | undefined;
    setElementByPos(pos: number, element: T): void;
    insert(pos: number, element: T, num?: number): number;
    find(element: T): VectorIterator<T>;
    reverse(): void;
    unique(): number;
    sort(cmp?: (x: T, y: T) => number): void;
    forEach(callback: (element: T, index: number, vector: Vector<T>) => void): void;
    [Symbol.iterator](): Generator<T, void, undefined>;
}
export default Vector;