mirror of
https://github.com/JasonYANG170/IOTConnect-Web.git
synced 2024-11-24 04:36:31 +00:00
1 line
8.8 KiB
Plaintext
1 line
8.8 KiB
Plaintext
|
{"version":3,"sources":["container/ContainerBase/index.js","../../src/container/ContainerBase/index.ts"],"names":["Object","defineProperty","exports","value","ContainerIterator","Container","Base","constructor","iteratorType","this","equals","iter","_node","_length","length","size","empty"],"mappings":"AAAA;;AAEAA,OAAOC,eAAeC,SAAS,KAAc;IAC3CC,OAAO;;;AAETD,QAAQE,oBAAoBF,QAAQG,YAAYH,QAAQI,YAAY;;ACG9D,MAAgBF;IAkBpBG,YAAsBC,IAAY;QAChCC,KAAKD,eAAeA;ADrBpB;IC6BFE,OAAOC;QACL,OAAOF,KAAKG,MAAUD,EAAKC;ADrB3B;;;ACsEHV,QAAAE,oBAAAA;;AAEK,MAAgBE;IAAtBC;QAKYE,KAAAI,IAAU;AAmCtB;IA5BMC;QACF,OAAOL,KAAKI;ADnEZ;IC2EFE;QACE,OAAON,KAAKI;ADnEZ;IC2EFG;QACE,OAAOP,KAAKI,MAAY;ADnExB;;;AC4EHX,QAAAI,OAAAA;;AAEK,MAAgBD,kBAAqBC;;AAgG1CJ,QAAAG,YAAAA","file":"index.js","sourcesContent":["export class ContainerIterator {\n /**\n * @internal\n */\n constructor(iteratorType = 0 /* IteratorType.NORMAL */) {\n this.iteratorType = iteratorType;\n }\n /**\n * @param iter - The other iterator you want to compare.\n * @returns Whether this equals to obj.\n * @example\n * container.find(1).equals(container.end());\n */\n equals(iter) {\n return this._node === iter._node;\n }\n}\nexport class Base {\n constructor() {\n /**\n * @description Container's size.\n * @internal\n */\n this._length = 0;\n }\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.length); // 2\n */\n get length() {\n return this._length;\n }\n /**\n * @returns The size of the container.\n * @example\n * const container = new Vector([1, 2]);\n * console.log(container.size()); // 2\n */\n size() {\n return this._length;\n }\n /**\n * @returns Whether the container is empty.\n * @example\n * container.clear();\n * console.log(container.empty()); // true\n */\n empty() {\n return this._length === 0;\n }\n}\nexport class Container extends Base {\n}\n","/**\n * @description The iterator type including `NORMAL` and `REVERSE`.\n */\nexport const enum IteratorType {\n NORMAL = 0,\n REVERSE = 1\n}\n\nexport abstract class ContainerIterator<T> {\n /**\n * @description The container pointed to by the iterator.\n */\n abstract readonly container: Container<T>;\n /**\n * @internal\n */\n abstract _node: unknown;\n /**\n * @description Iterator's type.\n * @example\n * console.log(container.end().iteratorType === IteratorType.NORMAL); // true\n */\n readonly iteratorType: IteratorType;\n /**\n * @internal\n */\n protected constructor(iteratorType = IteratorType.NORMAL) {\n this.iteratorType = iteratorType;\n }\n /**\n * @param iter - The other iterator you want to compare.\n * @returns Whether this equals to obj.\n * @example\n * container.find(1).equals(container.end());\n */\n equals(iter: ContainerIterator<T>) {\n return this._node === iter._node;\n }\n /**\n * @description Pointers to element.\n * @returns The value of the pointer's element.\n * @example\n * const val = container.begin().pointer;\n */\n abstract get pointer(): T;\n /**\n * @description Set pointer's value (some containers are unavailable).\n * @param newValue - The new value you want to set.\n * @example\n * (<LinkList<number>>container).begin().pointer = 1;\n */\n abstract set pointer(newValue: T);\n /**\n * @description Move `this` iterator to pre.\n * @returns The iterator's self.\n * @example\n * const iter = container.find(1); // container = [0, 1]\n * const pre = iter.pre();\n * console.log(pre === iter); // true\n * console.log(pre.equals(iter)); // true\n * console.log(pre.pointer, iter.pointer); // 0, 0\n */\n abstract pre(): this;\n /**\n * @description Move `this` iterator to next.\n * @returns The iterator's self.\n * @example\n * const iter = container.find(1); // container = [1, 2]\n * const next = iter.next();\n * console.log(ne
|