working rss feed to nostr publish
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IArrayContainer } from "../../base/container/IArrayContainer";
|
||||
import { ArrayIteratorBase } from "./ArrayIteratorBase";
|
||||
import { ArrayContainer } from "../container/linear/ArrayContainer";
|
||||
import { ArrayReverseIterator } from "./ArrayReverseIterator";
|
||||
export declare class ArrayIterator<T, SourceT extends ArrayContainer<T, SourceT, SourceT, ArrayIterator<T, SourceT>, ArrayReverseIterator<T, SourceT>, T>> extends ArrayIteratorBase<T, SourceT, SourceT, ArrayIterator<T, SourceT>, ArrayReverseIterator<T, SourceT>, T> implements IArrayContainer.Iterator<T, SourceT, ArrayIterator<T, SourceT>, ArrayReverseIterator<T, SourceT>> {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
reverse(): ArrayReverseIterator<T, SourceT>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
source(): SourceT;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ArrayIterator = void 0;
|
||||
var ArrayIteratorBase_1 = require("./ArrayIteratorBase");
|
||||
var ArrayReverseIterator_1 = require("./ArrayReverseIterator");
|
||||
var ArrayIterator = /** @class */ (function (_super) {
|
||||
__extends(ArrayIterator, _super);
|
||||
function ArrayIterator() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayIterator.prototype.reverse = function () {
|
||||
return new ArrayReverseIterator_1.ArrayReverseIterator(this);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayIterator.prototype.source = function () {
|
||||
return this._Get_array();
|
||||
};
|
||||
return ArrayIterator;
|
||||
}(ArrayIteratorBase_1.ArrayIteratorBase));
|
||||
exports.ArrayIterator = ArrayIterator;
|
||||
//# sourceMappingURL=ArrayIterator.js.map
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IContainer } from "../../base/container/IContainer";
|
||||
import { IRandomAccessIterator } from "../../iterator/IRandomAccessIterator";
|
||||
import { ArrayContainer } from "../container/linear/ArrayContainer";
|
||||
import { ArrayReverseIteratorBase } from "./ArrayReverseIteratorBase";
|
||||
/**
|
||||
* Iterator of Array Containers.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare abstract class ArrayIteratorBase<T extends ElemT, SourceT extends IContainer<T, SourceT, IteratorT, ReverseT, ElemT>, ArrayT extends ArrayContainer<T, SourceT, ArrayT, IteratorT, ReverseT, ElemT>, IteratorT extends ArrayIteratorBase<T, SourceT, ArrayT, IteratorT, ReverseT, ElemT>, ReverseT extends ArrayReverseIteratorBase<T, SourceT, ArrayT, IteratorT, ReverseT, ElemT>, ElemT> implements IContainer.Iterator<T, SourceT, IteratorT, ReverseT, ElemT>, IRandomAccessIterator<T, IteratorT> {
|
||||
private array_;
|
||||
private index_;
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param source Source container.
|
||||
* @param index Index number.
|
||||
*/
|
||||
constructor(array: ArrayT, index: number);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
abstract reverse(): ReverseT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
abstract source(): SourceT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
index(): number;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get value(): T;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
set value(val: T);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
prev(): IteratorT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
next(): IteratorT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
advance(n: number): IteratorT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
equals(obj: IteratorT): boolean;
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ArrayIteratorBase = void 0;
|
||||
var comparators_1 = require("../../functional/comparators");
|
||||
/**
|
||||
* Iterator of Array Containers.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var ArrayIteratorBase = /** @class */ (function () {
|
||||
/* ---------------------------------------------------------
|
||||
CONSTRUCTORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param source Source container.
|
||||
* @param index Index number.
|
||||
*/
|
||||
function ArrayIteratorBase(array, index) {
|
||||
this.array_ = array;
|
||||
this.index_ = index;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
ArrayIteratorBase.prototype._Get_array = function () {
|
||||
return this.array_;
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayIteratorBase.prototype.index = function () {
|
||||
return this.index_;
|
||||
};
|
||||
Object.defineProperty(ArrayIteratorBase.prototype, "value", {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get: function () {
|
||||
return this.array_.at(this.index_);
|
||||
},
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
set: function (val) {
|
||||
this.array_.set(this.index_, val);
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
/* ---------------------------------------------------------
|
||||
MOVERS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayIteratorBase.prototype.prev = function () {
|
||||
return this.advance(-1);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayIteratorBase.prototype.next = function () {
|
||||
return this.advance(1);
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayIteratorBase.prototype.advance = function (n) {
|
||||
return this.array_.nth(this.index_ + n);
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
COMPARES
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayIteratorBase.prototype.equals = function (obj) {
|
||||
return (0, comparators_1.equal_to)(this.array_, obj.array_) && this.index_ === obj.index_;
|
||||
};
|
||||
return ArrayIteratorBase;
|
||||
}());
|
||||
exports.ArrayIteratorBase = ArrayIteratorBase;
|
||||
//# sourceMappingURL=ArrayIteratorBase.js.map
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IArrayContainer } from "../../base/container/IArrayContainer";
|
||||
import { ArrayReverseIteratorBase } from "./ArrayReverseIteratorBase";
|
||||
import { ArrayContainer } from "../container/linear/ArrayContainer";
|
||||
import { ArrayIterator } from "./ArrayIterator";
|
||||
export declare class ArrayReverseIterator<T, SourceT extends ArrayContainer<T, SourceT, SourceT, ArrayIterator<T, SourceT>, ArrayReverseIterator<T, SourceT>, T>> extends ArrayReverseIteratorBase<T, SourceT, SourceT, ArrayIterator<T, SourceT>, ArrayReverseIterator<T, SourceT>, T> implements IArrayContainer.ReverseIterator<T, SourceT, ArrayIterator<T, SourceT>, ArrayReverseIterator<T, SourceT>> {
|
||||
protected _Create_neighbor(base: ArrayIterator<T, SourceT>): ArrayReverseIterator<T, SourceT>;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ArrayReverseIterator = void 0;
|
||||
var ArrayReverseIteratorBase_1 = require("./ArrayReverseIteratorBase");
|
||||
var ArrayReverseIterator = /** @class */ (function (_super) {
|
||||
__extends(ArrayReverseIterator, _super);
|
||||
function ArrayReverseIterator() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
ArrayReverseIterator.prototype._Create_neighbor = function (base) {
|
||||
return new ArrayReverseIterator(base);
|
||||
};
|
||||
return ArrayReverseIterator;
|
||||
}(ArrayReverseIteratorBase_1.ArrayReverseIteratorBase));
|
||||
exports.ArrayReverseIterator = ArrayReverseIterator;
|
||||
//# sourceMappingURL=ArrayReverseIterator.js.map
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IRandomAccessIterator } from "../../iterator/IRandomAccessIterator";
|
||||
import { ReverseIterator } from "./ReverseIterator";
|
||||
import { IContainer } from "../../base/container/IContainer";
|
||||
import { ArrayContainer } from "../container/linear/ArrayContainer";
|
||||
import { ArrayIteratorBase } from "./ArrayIteratorBase";
|
||||
/**
|
||||
* Reverse iterator of Array Containers.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare abstract class ArrayReverseIteratorBase<T extends ElemT, SourceT extends IContainer<T, SourceT, IteratorT, ReverseT, ElemT>, ArrayT extends ArrayContainer<T, SourceT, ArrayT, IteratorT, ReverseT, ElemT>, IteratorT extends ArrayIteratorBase<T, SourceT, ArrayT, IteratorT, ReverseT, ElemT>, ReverseT extends ArrayReverseIteratorBase<T, SourceT, ArrayT, IteratorT, ReverseT, ElemT>, ElemT> extends ReverseIterator<T, SourceT, IteratorT, ReverseT, ElemT> implements IRandomAccessIterator<T, ReverseT> {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
advance(n: number): ReverseT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
index(): number;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get value(): T;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
set value(val: T);
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ArrayReverseIteratorBase = void 0;
|
||||
var ReverseIterator_1 = require("./ReverseIterator");
|
||||
/**
|
||||
* Reverse iterator of Array Containers.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var ArrayReverseIteratorBase = /** @class */ (function (_super) {
|
||||
__extends(ArrayReverseIteratorBase, _super);
|
||||
function ArrayReverseIteratorBase() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
/* ---------------------------------------------------------
|
||||
CONSTRUCTORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayReverseIteratorBase.prototype.advance = function (n) {
|
||||
return this._Create_neighbor(this.base().advance(-n));
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
ACCESSORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ArrayReverseIteratorBase.prototype.index = function () {
|
||||
return this.base_.index();
|
||||
};
|
||||
Object.defineProperty(ArrayReverseIteratorBase.prototype, "value", {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get: function () {
|
||||
return this.base_.value;
|
||||
},
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
set: function (val) {
|
||||
this.base_.value = val;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return ArrayReverseIteratorBase;
|
||||
}(ReverseIterator_1.ReverseIterator));
|
||||
exports.ArrayReverseIteratorBase = ArrayReverseIteratorBase;
|
||||
//# sourceMappingURL=ArrayReverseIteratorBase.js.map
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IForwardIterator } from "../../iterator/IForwardIterator";
|
||||
import { Writeonly } from "../functional/Writeonly";
|
||||
export declare abstract class InsertIteratorBase<T, This extends InsertIteratorBase<T, This>> implements Writeonly<IForwardIterator<T, This>> {
|
||||
/**
|
||||
* Set value.
|
||||
*
|
||||
* @param val The value to set.
|
||||
*/
|
||||
abstract set value(val: T);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
next(): This;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
abstract equals(obj: This): boolean;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.InsertIteratorBase = void 0;
|
||||
var InsertIteratorBase = /** @class */ (function () {
|
||||
function InsertIteratorBase() {
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
InsertIteratorBase.prototype.next = function () {
|
||||
return this;
|
||||
};
|
||||
return InsertIteratorBase;
|
||||
}());
|
||||
exports.InsertIteratorBase = InsertIteratorBase;
|
||||
//# sourceMappingURL=InsertIteratorBase.js.map
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IContainer } from "../../base/container/IContainer";
|
||||
import { ReverseIterator } from "./ReverseIterator";
|
||||
/**
|
||||
* Basic List Iterator.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare abstract class ListIterator<T extends Elem, SourceT extends IContainer<T, SourceT, IteratorT, ReverseIteratorT, Elem>, IteratorT extends ListIterator<T, SourceT, IteratorT, ReverseIteratorT, Elem>, ReverseIteratorT extends ReverseIterator<T, SourceT, IteratorT, ReverseIteratorT, Elem>, Elem> implements Readonly<IContainer.Iterator<T, SourceT, IteratorT, ReverseIteratorT, Elem>> {
|
||||
private prev_;
|
||||
private next_;
|
||||
protected value_: T;
|
||||
protected constructor(prev: IteratorT, next: IteratorT, value: T);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
abstract reverse(): ReverseIteratorT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
abstract source(): SourceT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
prev(): IteratorT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
next(): IteratorT;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get value(): T;
|
||||
protected _Try_value(): void;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
equals(obj: IteratorT): boolean;
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ListIterator = void 0;
|
||||
var ErrorGenerator_1 = require("../exception/ErrorGenerator");
|
||||
/**
|
||||
* Basic List Iterator.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var ListIterator = /** @class */ (function () {
|
||||
/* ---------------------------------------------------------------
|
||||
CONSTRUCTORS
|
||||
--------------------------------------------------------------- */
|
||||
function ListIterator(prev, next, value) {
|
||||
this.prev_ = prev;
|
||||
this.next_ = next;
|
||||
this.value_ = value;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
ListIterator._Set_prev = function (it, prev) {
|
||||
it.prev_ = prev;
|
||||
};
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
ListIterator._Set_next = function (it, next) {
|
||||
it.next_ = next;
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ListIterator.prototype.prev = function () {
|
||||
return this.prev_;
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ListIterator.prototype.next = function () {
|
||||
return this.next_;
|
||||
};
|
||||
Object.defineProperty(ListIterator.prototype, "value", {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get: function () {
|
||||
this._Try_value();
|
||||
return this.value_;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
ListIterator.prototype._Try_value = function () {
|
||||
if (this.value_ === undefined &&
|
||||
this.equals(this.source().end()) === true)
|
||||
throw ErrorGenerator_1.ErrorGenerator.iterator_end_value(this.source());
|
||||
};
|
||||
/* ---------------------------------------------------------------
|
||||
COMPARISON
|
||||
--------------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ListIterator.prototype.equals = function (obj) {
|
||||
return this === obj;
|
||||
};
|
||||
return ListIterator;
|
||||
}());
|
||||
exports.ListIterator = ListIterator;
|
||||
//# sourceMappingURL=ListIterator.js.map
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.base
|
||||
*/
|
||||
import { IContainer } from "../../base/container/IContainer";
|
||||
/**
|
||||
* Basic reverse iterator.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare abstract class ReverseIterator<T extends PElem, Source extends IContainer<T, Source, Base, This, PElem>, Base extends IContainer.Iterator<T, Source, Base, This, PElem>, This extends ReverseIterator<T, Source, Base, This, PElem>, PElem = T> implements IContainer.ReverseIterator<T, Source, Base, This, PElem> {
|
||||
protected base_: Base;
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param base The base iterator.
|
||||
*/
|
||||
constructor(base: Base);
|
||||
protected abstract _Create_neighbor(base: Base): This;
|
||||
/**
|
||||
* Get source container.
|
||||
*
|
||||
* @return The source container.
|
||||
*/
|
||||
source(): Source;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
base(): Base;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get value(): T;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
prev(): This;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
next(): This;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
equals(obj: This): boolean;
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ReverseIterator = void 0;
|
||||
/**
|
||||
* Basic reverse iterator.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var ReverseIterator = /** @class */ (function () {
|
||||
/* ---------------------------------------------------------
|
||||
CONSTRUCTORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param base The base iterator.
|
||||
*/
|
||||
function ReverseIterator(base) {
|
||||
this.base_ = base.prev();
|
||||
}
|
||||
/* ---------------------------------------------------------
|
||||
ACCESSORS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* Get source container.
|
||||
*
|
||||
* @return The source container.
|
||||
*/
|
||||
ReverseIterator.prototype.source = function () {
|
||||
return this.base_.source();
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ReverseIterator.prototype.base = function () {
|
||||
return this.base_.next();
|
||||
};
|
||||
Object.defineProperty(ReverseIterator.prototype, "value", {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
get: function () {
|
||||
return this.base_.value;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
/* ---------------------------------------------------------
|
||||
MOVERS
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ReverseIterator.prototype.prev = function () {
|
||||
// this.base().next()
|
||||
return this._Create_neighbor(this.base().next());
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ReverseIterator.prototype.next = function () {
|
||||
// this.base().prev()
|
||||
return this._Create_neighbor(this.base_);
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
COMPARES
|
||||
--------------------------------------------------------- */
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ReverseIterator.prototype.equals = function (obj) {
|
||||
return this.base_.equals(obj.base_);
|
||||
};
|
||||
return ReverseIterator;
|
||||
}());
|
||||
exports.ReverseIterator = ReverseIterator;
|
||||
//# sourceMappingURL=ReverseIterator.js.map
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IForwardIterator } from "../../../iterator/IForwardIterator";
|
||||
/**
|
||||
* Adaptor for `for ... of` iteration.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
export declare class ForOfAdaptor<T, InputIterator extends Readonly<IForwardIterator<T, InputIterator>>> implements IterableIterator<T> {
|
||||
private it_;
|
||||
private last_;
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param first Input iteartor of the first position.
|
||||
* @param last Input iterator of the last position.
|
||||
*/
|
||||
constructor(first: InputIterator, last: InputIterator);
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
next(): IteratorResult<T>;
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
[Symbol.iterator](): IterableIterator<T>;
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ForOfAdaptor = void 0;
|
||||
/**
|
||||
* Adaptor for `for ... of` iteration.
|
||||
*
|
||||
* @author Jeongho Nam - https://github.com/samchon
|
||||
*/
|
||||
var ForOfAdaptor = /** @class */ (function () {
|
||||
/**
|
||||
* Initializer Constructor.
|
||||
*
|
||||
* @param first Input iteartor of the first position.
|
||||
* @param last Input iterator of the last position.
|
||||
*/
|
||||
function ForOfAdaptor(first, last) {
|
||||
this.it_ = first;
|
||||
this.last_ = last;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ForOfAdaptor.prototype.next = function () {
|
||||
if (this.it_.equals(this.last_))
|
||||
return {
|
||||
done: true,
|
||||
value: undefined,
|
||||
};
|
||||
else {
|
||||
var it = this.it_;
|
||||
this.it_ = this.it_.next();
|
||||
return {
|
||||
done: false,
|
||||
value: it.value,
|
||||
};
|
||||
}
|
||||
};
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ForOfAdaptor.prototype[Symbol.iterator] = function () {
|
||||
return this;
|
||||
};
|
||||
return ForOfAdaptor;
|
||||
}());
|
||||
exports.ForOfAdaptor = ForOfAdaptor;
|
||||
//# sourceMappingURL=ForOfAdaptor.js.map
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IForwardIterator } from "../../../iterator/IForwardIterator";
|
||||
export declare class NativeArrayIterator<T> implements Readonly<IForwardIterator<T, NativeArrayIterator<T>>> {
|
||||
private data_;
|
||||
private index_;
|
||||
constructor(data: Array<T>, index: number);
|
||||
index(): number;
|
||||
get value(): T;
|
||||
prev(): NativeArrayIterator<T>;
|
||||
next(): NativeArrayIterator<T>;
|
||||
advance(n: number): NativeArrayIterator<T>;
|
||||
equals(obj: NativeArrayIterator<T>): boolean;
|
||||
swap(obj: NativeArrayIterator<T>): void;
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NativeArrayIterator = void 0;
|
||||
var NativeArrayIterator = /** @class */ (function () {
|
||||
/* ---------------------------------------------------------
|
||||
CONSTRUCTORS
|
||||
--------------------------------------------------------- */
|
||||
function NativeArrayIterator(data, index) {
|
||||
this.data_ = data;
|
||||
this.index_ = index;
|
||||
}
|
||||
/* ---------------------------------------------------------
|
||||
ACCESSORS
|
||||
--------------------------------------------------------- */
|
||||
NativeArrayIterator.prototype.index = function () {
|
||||
return this.index_;
|
||||
};
|
||||
Object.defineProperty(NativeArrayIterator.prototype, "value", {
|
||||
get: function () {
|
||||
return this.data_[this.index_];
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
/* ---------------------------------------------------------
|
||||
MOVERS
|
||||
--------------------------------------------------------- */
|
||||
NativeArrayIterator.prototype.prev = function () {
|
||||
--this.index_;
|
||||
return this;
|
||||
};
|
||||
NativeArrayIterator.prototype.next = function () {
|
||||
++this.index_;
|
||||
return this;
|
||||
};
|
||||
NativeArrayIterator.prototype.advance = function (n) {
|
||||
this.index_ += n;
|
||||
return this;
|
||||
};
|
||||
/* ---------------------------------------------------------
|
||||
COMPARES
|
||||
--------------------------------------------------------- */
|
||||
NativeArrayIterator.prototype.equals = function (obj) {
|
||||
return this.data_ === obj.data_ && this.index_ === obj.index_;
|
||||
};
|
||||
NativeArrayIterator.prototype.swap = function (obj) {
|
||||
var _a, _b;
|
||||
_a = __read([obj.data_, this.data_], 2), this.data_ = _a[0], obj.data_ = _a[1];
|
||||
_b = __read([obj.index_, this.index_], 2), this.index_ = _b[0], obj.index_ = _b[1];
|
||||
};
|
||||
return NativeArrayIterator;
|
||||
}());
|
||||
exports.NativeArrayIterator = NativeArrayIterator;
|
||||
//# sourceMappingURL=NativeArrayIterator.js.map
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @packageDocumentation
|
||||
* @module std.internal
|
||||
*/
|
||||
import { IForwardIterator } from "../../../iterator/IForwardIterator";
|
||||
export declare class Repeater<T> implements Readonly<IForwardIterator<T, Repeater<T>>> {
|
||||
private index_;
|
||||
private value_;
|
||||
constructor(index: number, value?: T);
|
||||
index(): number;
|
||||
get value(): T;
|
||||
next(): Repeater<T>;
|
||||
equals(obj: Repeater<T>): boolean;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Repeater = void 0;
|
||||
var Repeater = /** @class */ (function () {
|
||||
/* ---------------------------------------------------------
|
||||
CONSTRUCTORS
|
||||
--------------------------------------------------------- */
|
||||
function Repeater(index, value) {
|
||||
this.index_ = index;
|
||||
this.value_ = value;
|
||||
}
|
||||
/* ---------------------------------------------------------
|
||||
ACCESSORS
|
||||
--------------------------------------------------------- */
|
||||
Repeater.prototype.index = function () {
|
||||
return this.index_;
|
||||
};
|
||||
Object.defineProperty(Repeater.prototype, "value", {
|
||||
get: function () {
|
||||
return this.value_;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
/* ---------------------------------------------------------
|
||||
MOVERS & COMPARE
|
||||
--------------------------------------------------------- */
|
||||
Repeater.prototype.next = function () {
|
||||
++this.index_;
|
||||
return this;
|
||||
};
|
||||
Repeater.prototype.equals = function (obj) {
|
||||
return this.index_ === obj.index_;
|
||||
};
|
||||
return Repeater;
|
||||
}());
|
||||
exports.Repeater = Repeater;
|
||||
//# sourceMappingURL=Repeater.js.map
|
||||
Reference in New Issue
Block a user