Insane number of adds to setup env and packages

This commit is contained in:
2022-11-07 17:45:54 -05:00
parent 62c2bb73a9
commit 55ecf095a9
3127 changed files with 485223 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
import { ContainerIterator } from "../../ContainerBase";
export declare abstract class RandomIterator<T> extends ContainerIterator<T> {
pre: () => this;
next: () => this;
get pointer(): T;
set pointer(newValue: T);
equals(obj: RandomIterator<T>): boolean;
}

View File

@@ -0,0 +1,67 @@
"use strict";
Object.defineProperty(exports, "t", {
value: true
});
exports.RandomIterator = void 0;
var _ContainerBase = require("../../ContainerBase");
class RandomIterator extends _ContainerBase.ContainerIterator {
constructor(t, r, e, i, s) {
super(s);
this.I = t;
this.D = r;
this.g = e;
this.m = i;
if (this.iteratorType === 0) {
this.pre = function() {
if (this.I === 0) {
throw new RangeError("Random iterator access denied!");
}
this.I -= 1;
return this;
};
this.next = function() {
if (this.I === this.D()) {
throw new RangeError("Random Iterator access denied!");
}
this.I += 1;
return this;
};
} else {
this.pre = function() {
if (this.I === this.D() - 1) {
throw new RangeError("Random iterator access denied!");
}
this.I += 1;
return this;
};
this.next = function() {
if (this.I === -1) {
throw new RangeError("Random iterator access denied!");
}
this.I -= 1;
return this;
};
}
}
get pointer() {
if (this.I < 0 || this.I > this.D() - 1) {
throw new RangeError;
}
return this.g(this.I);
}
set pointer(t) {
if (this.I < 0 || this.I > this.D() - 1) {
throw new RangeError;
}
this.m(this.I, t);
}
equals(t) {
return this.I === t.I;
}
}
exports.RandomIterator = RandomIterator;

View File

@@ -0,0 +1,44 @@
import { Container } from "../../ContainerBase";
declare abstract class SequentialContainer<T> extends Container<T> {
/**
* @description Push the element to the back.
* @param element The element you want to push.
*/
abstract pushBack(element: T): void;
/**
* @description Removes the last element.
*/
abstract popBack(): void;
/**
* @description Sets element by position.
* @param pos The position you want to change.
* @param element The element's value you want to update.
*/
abstract setElementByPos(pos: number, element: T): void;
/**
* @description Removes the elements of the specified value.
* @param value The value you want to remove.
*/
abstract eraseElementByValue(value: T): void;
/**
* @description Insert several elements after the specified position.
* @param pos The position you want to insert.
* @param element The element you want to insert.
* @param num The number of elements you want to insert (default 1).
*/
abstract insert(pos: number, element: T, num?: number): void;
/**
* @description Reverses the container.
*/
abstract reverse(): void;
/**
* @description Removes the duplication of elements in the container.
*/
abstract unique(): void;
/**
* @description Sort the container.
* @param cmp Comparison function.
*/
abstract sort(cmp?: (x: T, y: T) => number): void;
}
export default SequentialContainer;

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "t", {
value: true
});
exports.default = void 0;
var _ContainerBase = require("../../ContainerBase");
class SequentialContainer extends _ContainerBase.Container {}
var _default = SequentialContainer;
exports.default = _default;