collect-your-stuff 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1379 -1379
- package/browser/collect-your-stuff.js +3809 -1715
- package/browser/collect-your-stuff.min.js +1 -1
- package/dist/collections/arrayable/ArrayElement.js +0 -1
- package/dist/collections/arrayable/ArrayElement.min.js +1 -1
- package/dist/collections/doubly-linked-list/DoubleLinker.js +0 -1
- package/dist/collections/doubly-linked-list/DoubleLinker.min.js +1 -1
- package/dist/collections/doubly-linked-list/DoublyLinkedList.js +2 -0
- package/dist/collections/doubly-linked-list/DoublyLinkedList.min.js +1 -1
- package/dist/collections/linked-list/Linker.js +0 -1
- package/dist/collections/linked-list/Linker.min.js +1 -1
- package/dist/collections/linked-tree-list/TreeLinker.js +1 -1
- package/dist/collections/linked-tree-list/TreeLinker.min.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,117 +13,114 @@ Data allocation and manipulation.
|
|
|
13
13
|
## Classes
|
|
14
14
|
|
|
15
15
|
<dl>
|
|
16
|
-
<dt><a href="#
|
|
17
|
-
<dd><p>
|
|
16
|
+
<dt><a href="#TreeLinkerIterator">TreeLinkerIterator</a></dt>
|
|
17
|
+
<dd><p>Class TreeLinkerIterator returns the next value taking a left-first approach down a tree.</p>
|
|
18
18
|
</dd>
|
|
19
|
-
<dt><a href="#
|
|
20
|
-
<dd><p>
|
|
19
|
+
<dt><a href="#Runnable">Runnable</a></dt>
|
|
20
|
+
<dd><p>Identify a class that can be run.</p>
|
|
21
21
|
</dd>
|
|
22
|
-
<dt><a href="#
|
|
23
|
-
<dd><p>
|
|
22
|
+
<dt><a href="#LinkerIterator">LinkerIterator</a></dt>
|
|
23
|
+
<dd><p>Class LinkerIterator returns the next value when using linkers of linked type lists.</p>
|
|
24
24
|
</dd>
|
|
25
|
-
<dt><a href="#
|
|
26
|
-
<dd><p>
|
|
25
|
+
<dt><a href="#DoubleLinkerIterator">DoubleLinkerIterator</a></dt>
|
|
26
|
+
<dd><p>Class DoubleLinkerIterator returns the next value when using linkers of linked type lists.</p>
|
|
27
27
|
</dd>
|
|
28
|
-
<dt><a href="#
|
|
29
|
-
<dd><p>
|
|
28
|
+
<dt><a href="#ArrayIterator">ArrayIterator</a></dt>
|
|
29
|
+
<dd><p>Class ArrayIterator returns the next value when using elements of array type list.</p>
|
|
30
30
|
</dd>
|
|
31
|
-
<dt><a href="#
|
|
32
|
-
<dd><p>
|
|
31
|
+
<dt><a href="#Stackable">Stackable</a> ⇐ <code><a href="#Linker">Linker</a></code></dt>
|
|
32
|
+
<dd><p>Stackable represents a runnable entry in stack.</p>
|
|
33
33
|
</dd>
|
|
34
|
-
<dt><a href="#
|
|
35
|
-
<dd><p>
|
|
34
|
+
<dt><a href="#Stack">Stack</a></dt>
|
|
35
|
+
<dd><p>Store a collection of items which can only be inserted and removed from the top.</p>
|
|
36
36
|
</dd>
|
|
37
|
-
<dt><a href="#
|
|
38
|
-
<dd><p>
|
|
37
|
+
<dt><a href="#Queueable">Queueable</a> ⇐ <code><a href="#Linker">Linker</a></code></dt>
|
|
38
|
+
<dd><p>Queueable represents a runnable entry in a queue.</p>
|
|
39
39
|
</dd>
|
|
40
40
|
<dt><a href="#Queue">Queue</a></dt>
|
|
41
41
|
<dd><p>Maintain a series of queued items.</p>
|
|
42
42
|
</dd>
|
|
43
|
-
<dt><a href="#
|
|
44
|
-
<dd><p>
|
|
43
|
+
<dt><a href="#TreeLinker">TreeLinker</a> ⇐ <code><a href="#DoubleLinker">DoubleLinker</a></code></dt>
|
|
44
|
+
<dd><p>TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.</p>
|
|
45
45
|
</dd>
|
|
46
|
-
<dt><a href="#
|
|
47
|
-
<dd><p>
|
|
46
|
+
<dt><a href="#LinkedTreeList">LinkedTreeList</a> ⇐ <code><a href="#DoublyLinkedList">DoublyLinkedList</a></code></dt>
|
|
47
|
+
<dd><p>LinkedTreeList represents a collection stored with a root and spreading in branching (tree) formation.</p>
|
|
48
48
|
</dd>
|
|
49
|
-
<dt><a href="#
|
|
50
|
-
<dd><p>
|
|
49
|
+
<dt><a href="#Linker">Linker</a> ⇐ <code><a href="#ArrayElement">ArrayElement</a></code></dt>
|
|
50
|
+
<dd><p>Linker represents a node in a LinkedList.</p>
|
|
51
51
|
</dd>
|
|
52
|
-
<dt><a href="#
|
|
53
|
-
<dd><p>
|
|
52
|
+
<dt><a href="#LinkedList">LinkedList</a> ⇐ <code><a href="#Arrayable">Arrayable</a></code></dt>
|
|
53
|
+
<dd><p>LinkedList represents a collection stored as a LinkedList with next references.</p>
|
|
54
54
|
</dd>
|
|
55
|
-
<dt><a href="#
|
|
56
|
-
<dd><p>
|
|
55
|
+
<dt><a href="#DoublyLinkedList">DoublyLinkedList</a> ⇐ <code><a href="#LinkedList">LinkedList</a></code></dt>
|
|
56
|
+
<dd><p>DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.</p>
|
|
57
57
|
</dd>
|
|
58
|
-
<dt><a href="#
|
|
59
|
-
<dd><p>
|
|
58
|
+
<dt><a href="#DoubleLinker">DoubleLinker</a> ⇐ <code><a href="#Linker">Linker</a></code></dt>
|
|
59
|
+
<dd><p>DoubleLinker represents a node in a DoublyLinkedList which is chained by next and prev.</p>
|
|
60
60
|
</dd>
|
|
61
|
-
<dt><a href="#
|
|
62
|
-
<dd><p>
|
|
61
|
+
<dt><a href="#Arrayable">Arrayable</a></dt>
|
|
62
|
+
<dd><p>Arrayable represents a collection stored as an array.</p>
|
|
63
63
|
</dd>
|
|
64
|
-
<dt><a href="#
|
|
65
|
-
<dd><p>
|
|
64
|
+
<dt><a href="#ArrayElement">ArrayElement</a></dt>
|
|
65
|
+
<dd><p>Element represents a node in an Arrayable.</p>
|
|
66
66
|
</dd>
|
|
67
67
|
</dl>
|
|
68
68
|
|
|
69
69
|
## Members
|
|
70
70
|
|
|
71
71
|
<dl>
|
|
72
|
-
<dt><a href="#
|
|
73
|
-
<dd><p>
|
|
74
|
-
</dd>
|
|
75
|
-
<dt><a href="#ArrayElement">ArrayElement</a> ⇒ <code><a href="#ArrayElement">ArrayElement</a></code></dt>
|
|
76
|
-
<dd><p>Make a new Element from the data given if it is not already a valid Element.</p>
|
|
72
|
+
<dt><a href="#Stackable">Stackable</a> ⇒ <code><a href="#Stackable">Stackable</a></code></dt>
|
|
73
|
+
<dd><p>Make a new Stackable from the data given if it is not already a valid Stackable.</p>
|
|
77
74
|
</dd>
|
|
78
|
-
<dt><a href="#
|
|
79
|
-
<dd><p>
|
|
75
|
+
<dt><a href="#Stack">Stack</a> ⇒ <code><a href="#Stack">Stack</a></code></dt>
|
|
76
|
+
<dd><p>Convert an array to a Stack.</p>
|
|
80
77
|
</dd>
|
|
81
|
-
<dt><a href="#
|
|
82
|
-
<dd><p>
|
|
78
|
+
<dt><a href="#Queueable">Queueable</a> ⇒ <code><a href="#Queueable">Queueable</a></code></dt>
|
|
79
|
+
<dd><p>Make a new Queueable from the data given if it is not already a valid Queueable.</p>
|
|
83
80
|
</dd>
|
|
84
|
-
<dt><a href="#
|
|
85
|
-
<dd><p>Convert an array to a
|
|
81
|
+
<dt><a href="#Queue">Queue</a> ⇒ <code><a href="#Queue">Queue</a></code></dt>
|
|
82
|
+
<dd><p>Convert an array to a Queue.</p>
|
|
86
83
|
</dd>
|
|
87
|
-
<dt><a href="#
|
|
88
|
-
<dd><p>Make a new
|
|
84
|
+
<dt><a href="#TreeLinker">TreeLinker</a> ⇒ <code><a href="#TreeLinker">TreeLinker</a></code></dt>
|
|
85
|
+
<dd><p>Make a new DoubleLinker from the data given if it is not already a valid Linker.</p>
|
|
89
86
|
</dd>
|
|
90
87
|
<dt><a href="#LinkedTreeList">LinkedTreeList</a> ⇒ <code><a href="#LinkedTreeList">LinkedTreeList</a></code></dt>
|
|
91
88
|
<dd><p>Convert an array into a LinkedTreeList instance, return the new instance.</p>
|
|
92
89
|
</dd>
|
|
93
|
-
<dt><a href="#
|
|
94
|
-
<dd><p>Make a new
|
|
90
|
+
<dt><a href="#Linker">Linker</a> ⇒ <code><a href="#Linker">Linker</a></code></dt>
|
|
91
|
+
<dd><p>Make a new Linker from the data given if it is not already a valid Linker.</p>
|
|
95
92
|
</dd>
|
|
96
|
-
<dt><a href="#
|
|
97
|
-
<dd><p>Convert an array to a
|
|
93
|
+
<dt><a href="#LinkedList">LinkedList</a> ⇒ <code><a href="#LinkedList">LinkedList</a></code></dt>
|
|
94
|
+
<dd><p>Convert an array to a LinkedList.</p>
|
|
98
95
|
</dd>
|
|
99
|
-
<dt><a href="#
|
|
100
|
-
<dd><p>
|
|
96
|
+
<dt><a href="#DoublyLinkedList">DoublyLinkedList</a> ⇒ <code><a href="#DoublyLinkedList">DoublyLinkedList</a></code></dt>
|
|
97
|
+
<dd><p>Convert an array into a DoublyLinkedList instance, return the new instance.</p>
|
|
101
98
|
</dd>
|
|
102
|
-
<dt><a href="#
|
|
103
|
-
<dd><p>
|
|
99
|
+
<dt><a href="#DoubleLinker">DoubleLinker</a> ⇒ <code><a href="#DoubleLinker">DoubleLinker</a></code></dt>
|
|
100
|
+
<dd><p>Make a new DoubleLinker from the data given if it is not already a valid Linker.</p>
|
|
104
101
|
</dd>
|
|
105
|
-
<dt><a href="#
|
|
106
|
-
<dd><p>
|
|
102
|
+
<dt><a href="#Arrayable">Arrayable</a> ⇒ <code><a href="#Arrayable">Arrayable</a></code></dt>
|
|
103
|
+
<dd><p>Convert an array to an Arrayable.</p>
|
|
104
|
+
</dd>
|
|
105
|
+
<dt><a href="#ArrayElement">ArrayElement</a> ⇒ <code><a href="#ArrayElement">ArrayElement</a></code></dt>
|
|
106
|
+
<dd><p>Make a new Element from the data given if it is not already a valid Element.</p>
|
|
107
107
|
</dd>
|
|
108
108
|
</dl>
|
|
109
109
|
|
|
110
110
|
## Constants
|
|
111
111
|
|
|
112
112
|
<dl>
|
|
113
|
-
<dt><a href="#recipes">recipes</a></dt>
|
|
114
|
-
<dd><p>List of class declarations that can be used to specify attributes for a style of object / class.</p>
|
|
115
|
-
</dd>
|
|
116
113
|
<dt><a href="#services">services</a></dt>
|
|
117
114
|
<dd><p>List helpful functions when dealing with collections.</p>
|
|
118
115
|
</dd>
|
|
116
|
+
<dt><a href="#recipes">recipes</a></dt>
|
|
117
|
+
<dd><p>List of class declarations that can be used to specify attributes for a style of object / class.</p>
|
|
118
|
+
</dd>
|
|
119
119
|
</dl>
|
|
120
120
|
|
|
121
121
|
## Functions
|
|
122
122
|
|
|
123
123
|
<dl>
|
|
124
|
-
<dt><a href="#parseTree">parseTree(tree, callback)</a> ⇒ <code>IsArrayable.<IsTreeNode></code></dt>
|
|
125
|
-
<dd><p>Loop over all the nodes in a tree starting from left and apply a callback for each</p>
|
|
126
|
-
</dd>
|
|
127
124
|
<dt><a href="#parseTreeNext">parseTreeNext(treeNode)</a> ⇒ <code>IsTreeNode</code> | <code>null</code></dt>
|
|
128
125
|
<dd><p>Be able to parse over every node in a tree.</p>
|
|
129
126
|
<ol>
|
|
@@ -136,6 +133,9 @@ Data allocation and manipulation.
|
|
|
136
133
|
<li>Stop at root (next is null and parent is null</li>
|
|
137
134
|
</ol>
|
|
138
135
|
</dd>
|
|
136
|
+
<dt><a href="#parseTree">parseTree(tree, callback)</a> ⇒ <code>IsArrayable.<IsTreeNode></code></dt>
|
|
137
|
+
<dd><p>Loop over all the nodes in a tree starting from left and apply a callback for each</p>
|
|
138
|
+
</dd>
|
|
139
139
|
</dl>
|
|
140
140
|
|
|
141
141
|
<a name="module_collect-your-stuff"></a>
|
|
@@ -151,383 +151,638 @@ All of the collections available.
|
|
|
151
151
|
All methods exported from this module are encapsulated within collect-your-stuff.
|
|
152
152
|
|
|
153
153
|
**Kind**: inner constant of [<code>collect-your-stuff</code>](#module_collect-your-stuff)
|
|
154
|
-
<a name="
|
|
154
|
+
<a name="TreeLinkerIterator"></a>
|
|
155
155
|
|
|
156
|
-
##
|
|
157
|
-
|
|
156
|
+
## TreeLinkerIterator
|
|
157
|
+
Class TreeLinkerIterator returns the next value taking a left-first approach down a tree.
|
|
158
158
|
|
|
159
159
|
**Kind**: global class
|
|
160
|
+
<a name="Runnable"></a>
|
|
160
161
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
* [.list](#Arrayable+list) ⇒ [<code>Array.<ArrayElement></code>](#ArrayElement)
|
|
164
|
-
* [.first](#Arrayable+first) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
165
|
-
* [.last](#Arrayable+last) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
166
|
-
* [.length](#Arrayable+length) ⇒ <code>number</code>
|
|
167
|
-
* [.initialize(initialList)](#Arrayable+initialize) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
168
|
-
* [.insertAfter(node, newNode)](#Arrayable+insertAfter) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
169
|
-
* [.insertBefore(node, newNode)](#Arrayable+insertBefore) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
170
|
-
* [.append(node, after)](#Arrayable+append) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
171
|
-
* [.prepend(node, before)](#Arrayable+prepend) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
172
|
-
* [.remove(node)](#Arrayable+remove) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
173
|
-
* [.item(index)](#Arrayable+item) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
174
|
-
* [.forEach(callback, thisArg)](#Arrayable+forEach) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
175
|
-
|
|
176
|
-
<a name="new_Arrayable_new"></a>
|
|
162
|
+
## Runnable
|
|
163
|
+
Identify a class that can be run.
|
|
177
164
|
|
|
178
|
-
|
|
179
|
-
Create the new Arrayable instance, configure the Arrayable class.
|
|
165
|
+
**Kind**: global class
|
|
180
166
|
|
|
181
|
-
|
|
167
|
+
* [Runnable](#Runnable)
|
|
168
|
+
* [new Runnable(data)](#new_Runnable_new)
|
|
169
|
+
* _instance_
|
|
170
|
+
* [.task](#Runnable+task) ⇒ <code>function</code>
|
|
171
|
+
* [.run()](#Runnable+run) ⇒ <code>\*</code>
|
|
172
|
+
* _static_
|
|
173
|
+
* [.isRunnable(thing)](#Runnable.isRunnable) ⇒ <code>boolean</code>
|
|
182
174
|
|
|
183
|
-
|
|
184
|
-
Retrieve a copy of the innerList used.
|
|
175
|
+
<a name="new_Runnable_new"></a>
|
|
185
176
|
|
|
186
|
-
|
|
187
|
-
|
|
177
|
+
### new Runnable(data)
|
|
178
|
+
Instantiate a Runnable class.
|
|
188
179
|
|
|
189
|
-
### arrayable.first ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
190
|
-
Retrieve the first Element from the Arrayable
|
|
191
180
|
|
|
192
|
-
|
|
193
|
-
|
|
181
|
+
| Param | Type |
|
|
182
|
+
| --- | --- |
|
|
183
|
+
| data | <code>\*</code> |
|
|
194
184
|
|
|
195
|
-
|
|
196
|
-
Retrieve the last Element from the Arrayable
|
|
185
|
+
<a name="Runnable+task"></a>
|
|
197
186
|
|
|
198
|
-
|
|
199
|
-
|
|
187
|
+
### runnable.task ⇒ <code>function</code>
|
|
188
|
+
Retrieve the data which should be formed as a task.
|
|
200
189
|
|
|
201
|
-
|
|
202
|
-
|
|
190
|
+
**Kind**: instance property of [<code>Runnable</code>](#Runnable)
|
|
191
|
+
<a name="Runnable+run"></a>
|
|
203
192
|
|
|
204
|
-
|
|
205
|
-
|
|
193
|
+
### runnable.run() ⇒ <code>\*</code>
|
|
194
|
+
Run the runnable task.
|
|
206
195
|
|
|
207
|
-
|
|
208
|
-
|
|
196
|
+
**Kind**: instance method of [<code>Runnable</code>](#Runnable)
|
|
197
|
+
<a name="Runnable.isRunnable"></a>
|
|
209
198
|
|
|
210
|
-
|
|
199
|
+
### Runnable.isRunnable(thing) ⇒ <code>boolean</code>
|
|
200
|
+
Check if a given thing is Runnable
|
|
211
201
|
|
|
212
|
-
|
|
213
|
-
| --- | --- | --- |
|
|
214
|
-
| initialList | [<code>Array.<ArrayElement></code>](#ArrayElement) | Give the array of elements to start in this Arrayable. |
|
|
202
|
+
**Kind**: static method of [<code>Runnable</code>](#Runnable)
|
|
215
203
|
|
|
216
|
-
|
|
204
|
+
| Param | Type |
|
|
205
|
+
| --- | --- |
|
|
206
|
+
| thing | <code>\*</code> |
|
|
217
207
|
|
|
218
|
-
|
|
219
|
-
Insert a new node (or data) after a node.
|
|
208
|
+
<a name="LinkerIterator"></a>
|
|
220
209
|
|
|
221
|
-
|
|
210
|
+
## LinkerIterator
|
|
211
|
+
Class LinkerIterator returns the next value when using linkers of linked type lists.
|
|
222
212
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
|
|
226
|
-
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go after the existing node |
|
|
213
|
+
**Kind**: global class
|
|
214
|
+
<a name="DoubleLinkerIterator"></a>
|
|
227
215
|
|
|
228
|
-
|
|
216
|
+
## DoubleLinkerIterator
|
|
217
|
+
Class DoubleLinkerIterator returns the next value when using linkers of linked type lists.
|
|
229
218
|
|
|
230
|
-
|
|
231
|
-
|
|
219
|
+
**Kind**: global class
|
|
220
|
+
<a name="ArrayIterator"></a>
|
|
232
221
|
|
|
233
|
-
|
|
222
|
+
## ArrayIterator
|
|
223
|
+
Class ArrayIterator returns the next value when using elements of array type list.
|
|
234
224
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
|
|
238
|
-
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go before the existing node |
|
|
225
|
+
**Kind**: global class
|
|
226
|
+
<a name="Stackable"></a>
|
|
239
227
|
|
|
240
|
-
<
|
|
228
|
+
## Stackable ⇐ [<code>Linker</code>](#Linker)
|
|
229
|
+
Stackable represents a runnable entry in stack.
|
|
241
230
|
|
|
242
|
-
|
|
243
|
-
|
|
231
|
+
**Kind**: global class
|
|
232
|
+
**Extends**: [<code>Linker</code>](#Linker)
|
|
244
233
|
|
|
245
|
-
|
|
234
|
+
* [Stackable](#Stackable) ⇐ [<code>Linker</code>](#Linker)
|
|
235
|
+
* [new Stackable([stackData])](#new_Stackable_new)
|
|
236
|
+
* _instance_
|
|
237
|
+
* [.task](#Stackable+task) ⇒ <code>\*</code>
|
|
238
|
+
* [.run()](#Stackable+run) ⇒ <code>\*</code>
|
|
239
|
+
* _static_
|
|
240
|
+
* [.fromArray([values], [classType])](#Stackable.fromArray) ⇒ <code>Object</code>
|
|
246
241
|
|
|
247
|
-
|
|
248
|
-
| --- | --- | --- |
|
|
249
|
-
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the end of the list |
|
|
250
|
-
| after | [<code>ArrayElement</code>](#ArrayElement) | The existing last node |
|
|
242
|
+
<a name="new_Stackable_new"></a>
|
|
251
243
|
|
|
252
|
-
|
|
244
|
+
### new Stackable([stackData])
|
|
245
|
+
Create a stackable item that can be used in a stack.
|
|
253
246
|
|
|
254
|
-
### arrayable.prepend(node, before) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
255
|
-
Add a node (or data) before the given (or first) node in the list.
|
|
256
247
|
|
|
257
|
-
|
|
248
|
+
| Param | Type | Default | Description |
|
|
249
|
+
| --- | --- | --- | --- |
|
|
250
|
+
| [stackData] | <code>Object</code> | <code>{}</code> | |
|
|
251
|
+
| [stackData.task] | <code>\*</code> | <code></code> | The data to be stored in this stackable |
|
|
252
|
+
| [stackData.next] | [<code>Stackable</code>](#Stackable) \| <code>null</code> | <code></code> | The reference to the next stackable if any |
|
|
253
|
+
| [stackData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Indicate if the stackable is ready to run |
|
|
258
254
|
|
|
259
|
-
|
|
260
|
-
| --- | --- | --- |
|
|
261
|
-
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the start of the list |
|
|
262
|
-
| before | [<code>ArrayElement</code>](#ArrayElement) | The existing first node |
|
|
255
|
+
<a name="Stackable+task"></a>
|
|
263
256
|
|
|
264
|
-
<
|
|
257
|
+
### stackable.task ⇒ <code>\*</code>
|
|
258
|
+
Retrieve the data which should be formed as a task.
|
|
265
259
|
|
|
266
|
-
|
|
267
|
-
|
|
260
|
+
**Kind**: instance property of [<code>Stackable</code>](#Stackable)
|
|
261
|
+
<a name="Stackable+run"></a>
|
|
268
262
|
|
|
269
|
-
|
|
263
|
+
### stackable.run() ⇒ <code>\*</code>
|
|
264
|
+
Run the stacked task.
|
|
270
265
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
| node | [<code>ArrayElement</code>](#ArrayElement) | The node we wish to remove (and it will be returned after removal) |
|
|
266
|
+
**Kind**: instance method of [<code>Stackable</code>](#Stackable)
|
|
267
|
+
<a name="Stackable.fromArray"></a>
|
|
274
268
|
|
|
275
|
-
<
|
|
269
|
+
### Stackable.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
270
|
+
Convert an array into Stackable instances, return the head and tail Stackables.
|
|
276
271
|
|
|
277
|
-
|
|
278
|
-
Retrieve an ArrayElement item from this list by numeric index, otherwise return null.
|
|
272
|
+
**Kind**: static method of [<code>Stackable</code>](#Stackable)
|
|
279
273
|
|
|
280
|
-
|
|
274
|
+
| Param | Type | Default | Description |
|
|
275
|
+
| --- | --- | --- | --- |
|
|
276
|
+
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of stackable linkers. |
|
|
277
|
+
| [classType] | <code>IsLinker</code> | <code>Stackable</code> | Provide the type of IsLinker to use. |
|
|
281
278
|
|
|
282
|
-
|
|
283
|
-
| --- | --- | --- |
|
|
284
|
-
| index | <code>number</code> | The integer number for retrieving a node by position. |
|
|
279
|
+
<a name="Stack"></a>
|
|
285
280
|
|
|
286
|
-
|
|
281
|
+
## Stack
|
|
282
|
+
Store a collection of items which can only be inserted and removed from the top.
|
|
287
283
|
|
|
288
|
-
|
|
289
|
-
Be able to run forEach on this Arrayable to iterate over the elements.
|
|
284
|
+
**Kind**: global class
|
|
290
285
|
|
|
291
|
-
|
|
286
|
+
* [Stack](#Stack)
|
|
287
|
+
* [new Stack(stackedList, listClass, stackableClass)](#new_Stack_new)
|
|
288
|
+
* [.empty()](#Stack+empty) ⇒ <code>boolean</code>
|
|
289
|
+
* [.top()](#Stack+top) ⇒ [<code>Stackable</code>](#Stackable)
|
|
290
|
+
* [.pop()](#Stack+pop) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
291
|
+
* [.push(stackable)](#Stack+push)
|
|
292
|
+
* [.remove()](#Stack+remove) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
293
|
+
* [.size()](#Stack+size) ⇒ <code>number</code>
|
|
294
|
+
|
|
295
|
+
<a name="new_Stack_new"></a>
|
|
296
|
+
|
|
297
|
+
### new Stack(stackedList, listClass, stackableClass)
|
|
298
|
+
Instantiate the state with the starter stacked list.
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
| Param | Type |
|
|
302
|
+
| --- | --- |
|
|
303
|
+
| stackedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) |
|
|
304
|
+
| listClass | <code>IsArrayable</code> |
|
|
305
|
+
| stackableClass | [<code>Stackable</code>](#Stackable) |
|
|
306
|
+
|
|
307
|
+
<a name="Stack+empty"></a>
|
|
308
|
+
|
|
309
|
+
### stack.empty() ⇒ <code>boolean</code>
|
|
310
|
+
Return true if the stack is empty (there are no tasks in the stacked list)
|
|
311
|
+
|
|
312
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
313
|
+
<a name="Stack+top"></a>
|
|
314
|
+
|
|
315
|
+
### stack.top() ⇒ [<code>Stackable</code>](#Stackable)
|
|
316
|
+
Take a look at the next stacked task
|
|
317
|
+
|
|
318
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
319
|
+
<a name="Stack+pop"></a>
|
|
320
|
+
|
|
321
|
+
### stack.pop() ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
322
|
+
Remove the next stacked task and return it.
|
|
323
|
+
|
|
324
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
325
|
+
<a name="Stack+push"></a>
|
|
326
|
+
|
|
327
|
+
### stack.push(stackable)
|
|
328
|
+
Push a stackable task to the top of the stack.
|
|
329
|
+
|
|
330
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
292
331
|
|
|
293
332
|
| Param | Type | Description |
|
|
294
333
|
| --- | --- | --- |
|
|
295
|
-
|
|
|
296
|
-
| thisArg | [<code>Arrayable</code>](#Arrayable) | Optional, 'this' reference |
|
|
334
|
+
| stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> | Add a new stackable to the top of the stack |
|
|
297
335
|
|
|
298
|
-
<a name="
|
|
336
|
+
<a name="Stack+remove"></a>
|
|
299
337
|
|
|
300
|
-
|
|
301
|
-
|
|
338
|
+
### stack.remove() ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
339
|
+
Remove the next stacked task and return it.
|
|
340
|
+
|
|
341
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
342
|
+
<a name="Stack+size"></a>
|
|
343
|
+
|
|
344
|
+
### stack.size() ⇒ <code>number</code>
|
|
345
|
+
Get the size of the current stack.
|
|
346
|
+
|
|
347
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
348
|
+
<a name="Queueable"></a>
|
|
349
|
+
|
|
350
|
+
## Queueable ⇐ [<code>Linker</code>](#Linker)
|
|
351
|
+
Queueable represents a runnable entry in a queue.
|
|
302
352
|
|
|
303
353
|
**Kind**: global class
|
|
354
|
+
**Extends**: [<code>Linker</code>](#Linker)
|
|
304
355
|
|
|
305
|
-
* [
|
|
306
|
-
* [new
|
|
307
|
-
*
|
|
356
|
+
* [Queueable](#Queueable) ⇐ [<code>Linker</code>](#Linker)
|
|
357
|
+
* [new Queueable([queueableData])](#new_Queueable_new)
|
|
358
|
+
* _instance_
|
|
359
|
+
* [.isReady](#Queueable+isReady) ⇒ <code>boolean</code>
|
|
360
|
+
* [.task](#Queueable+task) ⇒ <code>\*</code>
|
|
361
|
+
* [.markCompleted(completeResponse)](#Queueable+markCompleted) ⇒ <code>completeResponse</code>
|
|
362
|
+
* [.run()](#Queueable+run) ⇒ <code>completeResponse</code>
|
|
363
|
+
* _static_
|
|
364
|
+
* [.fromArray(values, [classType])](#Queueable.fromArray) ⇒ <code>Object</code>
|
|
308
365
|
|
|
309
|
-
<a name="
|
|
366
|
+
<a name="new_Queueable_new"></a>
|
|
310
367
|
|
|
311
|
-
### new
|
|
312
|
-
Create
|
|
368
|
+
### new Queueable([queueableData])
|
|
369
|
+
Create a queueable item that can be used in a queue.
|
|
313
370
|
|
|
314
371
|
|
|
315
372
|
| Param | Type | Default | Description |
|
|
316
373
|
| --- | --- | --- | --- |
|
|
317
|
-
| [
|
|
374
|
+
| [queueableData] | <code>Object</code> | <code>{}</code> | |
|
|
375
|
+
| [queueableData.task] | <code>\*</code> | <code></code> | The data to be stored in this queueable |
|
|
376
|
+
| [queueableData.next] | [<code>Queueable</code>](#Queueable) \| <code>null</code> | <code></code> | The reference to the next queueable if any |
|
|
377
|
+
| [queueableData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Indicate if the queueable is ready to run |
|
|
318
378
|
|
|
319
|
-
<a name="
|
|
379
|
+
<a name="Queueable+isReady"></a>
|
|
320
380
|
|
|
321
|
-
###
|
|
322
|
-
|
|
381
|
+
### queueable.isReady ⇒ <code>boolean</code>
|
|
382
|
+
Check ready state.
|
|
323
383
|
|
|
324
|
-
**Kind**:
|
|
384
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
385
|
+
<a name="Queueable+task"></a>
|
|
386
|
+
|
|
387
|
+
### queueable.task ⇒ <code>\*</code>
|
|
388
|
+
Retrieve the data which should be formed as a task.
|
|
389
|
+
|
|
390
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
391
|
+
<a name="Queueable+markCompleted"></a>
|
|
392
|
+
|
|
393
|
+
### queueable.markCompleted(completeResponse) ⇒ <code>completeResponse</code>
|
|
394
|
+
Set this queueable as completed.
|
|
395
|
+
|
|
396
|
+
**Kind**: instance method of [<code>Queueable</code>](#Queueable)
|
|
325
397
|
|
|
326
398
|
| Param | Type | Default | Description |
|
|
327
399
|
| --- | --- | --- | --- |
|
|
328
|
-
|
|
|
329
|
-
| [
|
|
400
|
+
| completeResponse | <code>Object</code> | | |
|
|
401
|
+
| [completeResponse.success] | <code>\*</code> | <code>true</code> | Indicate when the task failed (use false) or give a success message |
|
|
402
|
+
| [completeResponse.error] | <code>\*</code> | <code>false</code> | Indicate a task was error-free (use false) or give an error message |
|
|
403
|
+
| [completeResponse.context] | <code>\*</code> | <code></code> | Provide additional data in the response |
|
|
330
404
|
|
|
331
|
-
<a name="
|
|
405
|
+
<a name="Queueable+run"></a>
|
|
332
406
|
|
|
333
|
-
|
|
334
|
-
|
|
407
|
+
### queueable.run() ⇒ <code>completeResponse</code>
|
|
408
|
+
Intend to run the queued task when it is ready. If ready, mark this task as running and run the task.
|
|
409
|
+
|
|
410
|
+
**Kind**: instance method of [<code>Queueable</code>](#Queueable)
|
|
411
|
+
<a name="Queueable.fromArray"></a>
|
|
412
|
+
|
|
413
|
+
### Queueable.fromArray(values, [classType]) ⇒ <code>Object</code>
|
|
414
|
+
Convert an array into Queueable instances, return the head and tail Queueables.
|
|
415
|
+
|
|
416
|
+
**Kind**: static method of [<code>Queueable</code>](#Queueable)
|
|
417
|
+
|
|
418
|
+
| Param | Type | Default | Description |
|
|
419
|
+
| --- | --- | --- | --- |
|
|
420
|
+
| values | <code>Array</code> | | Provide an array of data that will be converted to a chain of queueable linkers. |
|
|
421
|
+
| [classType] | <code>IsLinker</code> | <code>Queueable</code> | Provide the type of IsLinker to use. |
|
|
422
|
+
|
|
423
|
+
<a name="Queue"></a>
|
|
424
|
+
|
|
425
|
+
## Queue
|
|
426
|
+
Maintain a series of queued items.
|
|
335
427
|
|
|
336
428
|
**Kind**: global class
|
|
337
|
-
**Extends**: [<code>Linker</code>](#Linker)
|
|
338
429
|
|
|
339
|
-
* [
|
|
340
|
-
* [new
|
|
341
|
-
* [.
|
|
430
|
+
* [Queue](#Queue)
|
|
431
|
+
* [new Queue(queuedList, listClass, queueableClass)](#new_Queue_new)
|
|
432
|
+
* [.dequeue()](#Queue+dequeue) ⇒ <code>completeResponse</code> \| <code>\*</code>
|
|
433
|
+
* [.empty()](#Queue+empty) ⇒ <code>boolean</code>
|
|
434
|
+
* [.enqueue(queueable)](#Queue+enqueue)
|
|
435
|
+
* [.peek()](#Queue+peek) ⇒ [<code>Queueable</code>](#Queueable)
|
|
436
|
+
* [.remove()](#Queue+remove) ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
|
|
437
|
+
* [.size()](#Queue+size) ⇒ <code>number</code>
|
|
342
438
|
|
|
343
|
-
<a name="
|
|
439
|
+
<a name="new_Queue_new"></a>
|
|
344
440
|
|
|
345
|
-
### new
|
|
346
|
-
|
|
441
|
+
### new Queue(queuedList, listClass, queueableClass)
|
|
442
|
+
Instantiate the queue with the given queue list.
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
| Param | Type | Description |
|
|
446
|
+
| --- | --- | --- |
|
|
447
|
+
| queuedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) | Give the list of queueables to start in this queue. |
|
|
448
|
+
| listClass | <code>IsArrayable</code> | |
|
|
449
|
+
| queueableClass | [<code>Queueable</code>](#Queueable) | |
|
|
450
|
+
|
|
451
|
+
<a name="Queue+dequeue"></a>
|
|
452
|
+
|
|
453
|
+
### queue.dequeue() ⇒ <code>completeResponse</code> \| <code>\*</code>
|
|
454
|
+
Take a queued task from the front of the queue and run it if ready.
|
|
455
|
+
|
|
456
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
457
|
+
<a name="Queue+empty"></a>
|
|
458
|
+
|
|
459
|
+
### queue.empty() ⇒ <code>boolean</code>
|
|
460
|
+
Return true if the queue is empty (there are no tasks in the queue list)
|
|
461
|
+
|
|
462
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
463
|
+
<a name="Queue+enqueue"></a>
|
|
464
|
+
|
|
465
|
+
### queue.enqueue(queueable)
|
|
466
|
+
Add a queued task to the end of the queue
|
|
467
|
+
|
|
468
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
469
|
+
|
|
470
|
+
| Param | Type | Description |
|
|
471
|
+
| --- | --- | --- |
|
|
472
|
+
| queueable | [<code>Queueable</code>](#Queueable) | Add a new queueable to the end of the queue |
|
|
473
|
+
|
|
474
|
+
<a name="Queue+peek"></a>
|
|
475
|
+
|
|
476
|
+
### queue.peek() ⇒ [<code>Queueable</code>](#Queueable)
|
|
477
|
+
Take a look at the next queued task
|
|
478
|
+
|
|
479
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
480
|
+
<a name="Queue+remove"></a>
|
|
481
|
+
|
|
482
|
+
### queue.remove() ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
|
|
483
|
+
Remove the next queued item and return it.
|
|
484
|
+
|
|
485
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
486
|
+
<a name="Queue+size"></a>
|
|
487
|
+
|
|
488
|
+
### queue.size() ⇒ <code>number</code>
|
|
489
|
+
Get the length of the current queue.
|
|
490
|
+
|
|
491
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
492
|
+
<a name="TreeLinker"></a>
|
|
493
|
+
|
|
494
|
+
## TreeLinker ⇐ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
495
|
+
TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.
|
|
496
|
+
|
|
497
|
+
**Kind**: global class
|
|
498
|
+
**Extends**: [<code>DoubleLinker</code>](#DoubleLinker)
|
|
499
|
+
|
|
500
|
+
* [TreeLinker](#TreeLinker) ⇐ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
501
|
+
* [new TreeLinker([settings], listClass)](#new_TreeLinker_new)
|
|
502
|
+
* _instance_
|
|
503
|
+
* [.childrenFromArray(children, listClass)](#TreeLinker+childrenFromArray) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
504
|
+
* _static_
|
|
505
|
+
* [.fromArray([values], [classType])](#TreeLinker.fromArray) ⇒ <code>Object</code>
|
|
506
|
+
|
|
507
|
+
<a name="new_TreeLinker_new"></a>
|
|
508
|
+
|
|
509
|
+
### new TreeLinker([settings], listClass)
|
|
510
|
+
Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.
|
|
347
511
|
|
|
348
512
|
|
|
349
513
|
| Param | Type | Default | Description |
|
|
350
514
|
| --- | --- | --- | --- |
|
|
351
|
-
| [
|
|
352
|
-
| [
|
|
353
|
-
| [
|
|
354
|
-
| [
|
|
515
|
+
| [settings] | <code>Object</code> | <code>{}</code> | |
|
|
516
|
+
| [settings.data] | <code>\*</code> | <code></code> | The data to be stored in this tree node |
|
|
517
|
+
| [settings.next] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to the next linker if any |
|
|
518
|
+
| [settings.prev] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to the previous linker if any |
|
|
519
|
+
| [settings.children] | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code></code> | The references to child linkers if any |
|
|
520
|
+
| [settings.parent] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to a parent linker if any |
|
|
521
|
+
| listClass | <code>IsArrayable.<IsTreeNode></code> | | Give the type of list to use for storing the children |
|
|
355
522
|
|
|
356
|
-
<a name="
|
|
523
|
+
<a name="TreeLinker+childrenFromArray"></a>
|
|
357
524
|
|
|
358
|
-
###
|
|
525
|
+
### treeLinker.childrenFromArray(children, listClass) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
526
|
+
Create the children for this tree from an array.
|
|
527
|
+
|
|
528
|
+
**Kind**: instance method of [<code>TreeLinker</code>](#TreeLinker)
|
|
529
|
+
|
|
530
|
+
| Param | Type | Description |
|
|
531
|
+
| --- | --- | --- |
|
|
532
|
+
| children | <code>Array</code> \| <code>null</code> | Provide an array of data / linker references to be children of this tree node. |
|
|
533
|
+
| listClass | <code>IsArrayable.<IsTreeNode></code> | Give the type of list to use for storing the children |
|
|
534
|
+
|
|
535
|
+
<a name="TreeLinker.fromArray"></a>
|
|
536
|
+
|
|
537
|
+
### TreeLinker.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
359
538
|
Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
|
|
360
539
|
|
|
361
|
-
**Kind**: static method of [<code>
|
|
540
|
+
**Kind**: static method of [<code>TreeLinker</code>](#TreeLinker)
|
|
362
541
|
|
|
363
542
|
| Param | Type | Default | Description |
|
|
364
543
|
| --- | --- | --- | --- |
|
|
365
|
-
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
|
|
366
|
-
| [classType] | <code>
|
|
544
|
+
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of tree-linkers. |
|
|
545
|
+
| [classType] | <code>IsTreeNode</code> | <code>TreeLinker</code> | Provide the type of IsTreeNode to use. |
|
|
367
546
|
|
|
368
|
-
<a name="
|
|
547
|
+
<a name="LinkedTreeList"></a>
|
|
369
548
|
|
|
370
|
-
##
|
|
371
|
-
|
|
549
|
+
## LinkedTreeList ⇐ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
550
|
+
LinkedTreeList represents a collection stored with a root and spreading in branching (tree) formation.
|
|
372
551
|
|
|
373
552
|
**Kind**: global class
|
|
374
|
-
**Extends**: [<code>
|
|
553
|
+
**Extends**: [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
375
554
|
|
|
376
|
-
* [
|
|
377
|
-
* [new
|
|
378
|
-
* [.list](#
|
|
379
|
-
* [.first](#
|
|
380
|
-
* [.last](#
|
|
381
|
-
* [.length](#
|
|
382
|
-
* [.
|
|
383
|
-
* [.
|
|
384
|
-
* [.
|
|
385
|
-
* [.
|
|
386
|
-
* [.
|
|
387
|
-
* [.
|
|
388
|
-
* [.
|
|
389
|
-
* [.
|
|
390
|
-
* [.
|
|
555
|
+
* [LinkedTreeList](#LinkedTreeList) ⇐ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
556
|
+
* [new LinkedTreeList()](#new_LinkedTreeList_new)
|
|
557
|
+
* [.list](#LinkedTreeList+list) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
558
|
+
* [.first](#LinkedTreeList+first) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
559
|
+
* [.last](#LinkedTreeList+last) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
560
|
+
* [.length](#LinkedTreeList+length) ⇒ <code>number</code>
|
|
561
|
+
* [.parent](#LinkedTreeList+parent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
562
|
+
* [.parent](#LinkedTreeList+parent)
|
|
563
|
+
* [.rootParent](#LinkedTreeList+rootParent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
564
|
+
* [.initialize(initialList)](#LinkedTreeList+initialize) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
565
|
+
* [.setChildren(item, children)](#LinkedTreeList+setChildren)
|
|
566
|
+
* [.insertAfter(node, newNode)](#LinkedTreeList+insertAfter) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
567
|
+
* [.insertBefore(node, newNode)](#LinkedTreeList+insertBefore) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
568
|
+
* [.append(node, after)](#LinkedTreeList+append) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
569
|
+
* [.prepend(node, before)](#LinkedTreeList+prepend) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
570
|
+
* [.remove(node)](#LinkedTreeList+remove) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
571
|
+
* [.reset()](#LinkedTreeList+reset) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
572
|
+
* [.item(index)](#LinkedTreeList+item) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
|
|
573
|
+
* [.forEach(callback, thisArg)](#LinkedTreeList+forEach)
|
|
391
574
|
|
|
392
|
-
<a name="
|
|
575
|
+
<a name="new_LinkedTreeList_new"></a>
|
|
393
576
|
|
|
394
|
-
### new
|
|
395
|
-
Create the new
|
|
577
|
+
### new LinkedTreeList()
|
|
578
|
+
Create the new LinkedTreeList instance, configure the list class.
|
|
396
579
|
|
|
397
|
-
<a name="
|
|
580
|
+
<a name="LinkedTreeList+list"></a>
|
|
398
581
|
|
|
399
|
-
###
|
|
582
|
+
### linkedTreeList.list ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
400
583
|
Retrieve a copy of the innerList used.
|
|
401
584
|
|
|
402
|
-
**Kind**: instance property of [<code>
|
|
403
|
-
**Overrides**: [<code>list</code>](#
|
|
404
|
-
<a name="
|
|
585
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
586
|
+
**Overrides**: [<code>list</code>](#DoublyLinkedList+list)
|
|
587
|
+
<a name="LinkedTreeList+first"></a>
|
|
405
588
|
|
|
406
|
-
###
|
|
407
|
-
Retrieve the first
|
|
589
|
+
### linkedTreeList.first ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
590
|
+
Retrieve the first TreeLinker in the list.
|
|
408
591
|
|
|
409
|
-
**Kind**: instance property of [<code>
|
|
410
|
-
**Overrides**: [<code>first</code>](#
|
|
411
|
-
<a name="
|
|
592
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
593
|
+
**Overrides**: [<code>first</code>](#DoublyLinkedList+first)
|
|
594
|
+
<a name="LinkedTreeList+last"></a>
|
|
412
595
|
|
|
413
|
-
###
|
|
414
|
-
Retrieve the last
|
|
596
|
+
### linkedTreeList.last ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
597
|
+
Retrieve the last TreeLinker in the list.
|
|
415
598
|
|
|
416
|
-
**Kind**: instance property of [<code>
|
|
417
|
-
**Overrides**: [<code>last</code>](#
|
|
418
|
-
<a name="
|
|
599
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
600
|
+
**Overrides**: [<code>last</code>](#DoublyLinkedList+last)
|
|
601
|
+
<a name="LinkedTreeList+length"></a>
|
|
419
602
|
|
|
420
|
-
###
|
|
603
|
+
### linkedTreeList.length ⇒ <code>number</code>
|
|
421
604
|
Return the length of the list.
|
|
422
605
|
|
|
423
|
-
**Kind**: instance property of [<code>
|
|
424
|
-
**Overrides**: [<code>length</code>](#
|
|
425
|
-
<a name="
|
|
606
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
607
|
+
**Overrides**: [<code>length</code>](#DoublyLinkedList+length)
|
|
608
|
+
<a name="LinkedTreeList+parent"></a>
|
|
426
609
|
|
|
427
|
-
###
|
|
610
|
+
### linkedTreeList.parent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
611
|
+
Get the parent of this tree list.
|
|
612
|
+
|
|
613
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
614
|
+
<a name="LinkedTreeList+parent"></a>
|
|
615
|
+
|
|
616
|
+
### linkedTreeList.parent
|
|
617
|
+
Set the parent of this tree list
|
|
618
|
+
|
|
619
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
620
|
+
|
|
621
|
+
| Param | Type | Description |
|
|
622
|
+
| --- | --- | --- |
|
|
623
|
+
| parent | [<code>TreeLinker</code>](#TreeLinker) | The new node to use as the parent for this group of children |
|
|
624
|
+
|
|
625
|
+
<a name="LinkedTreeList+rootParent"></a>
|
|
626
|
+
|
|
627
|
+
### linkedTreeList.rootParent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
628
|
+
Return the root parent of the entire tree.
|
|
629
|
+
|
|
630
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
631
|
+
<a name="LinkedTreeList+initialize"></a>
|
|
632
|
+
|
|
633
|
+
### linkedTreeList.initialize(initialList) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
428
634
|
Initialize the inner list, should only run once.
|
|
429
635
|
|
|
430
|
-
**Kind**: instance method of [<code>
|
|
431
|
-
**Overrides**: [<code>initialize</code>](#
|
|
636
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
637
|
+
**Overrides**: [<code>initialize</code>](#DoublyLinkedList+initialize)
|
|
432
638
|
|
|
433
639
|
| Param | Type | Description |
|
|
434
640
|
| --- | --- | --- |
|
|
435
|
-
| initialList | [<code>
|
|
641
|
+
| initialList | [<code>TreeLinker</code>](#TreeLinker) | Give the list of tree-linkers to start in this linked-tree-list. |
|
|
436
642
|
|
|
437
|
-
<a name="
|
|
643
|
+
<a name="LinkedTreeList+setChildren"></a>
|
|
438
644
|
|
|
439
|
-
###
|
|
645
|
+
### linkedTreeList.setChildren(item, children)
|
|
646
|
+
Set the children on a parent item.
|
|
647
|
+
|
|
648
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
649
|
+
|
|
650
|
+
| Param | Type | Description |
|
|
651
|
+
| --- | --- | --- |
|
|
652
|
+
| item | [<code>TreeLinker</code>](#TreeLinker) | The TreeLinker node that will be the parent of the children |
|
|
653
|
+
| children | [<code>LinkedTreeList</code>](#LinkedTreeList) | The LinkedTreeList which has the child nodes to use |
|
|
654
|
+
|
|
655
|
+
<a name="LinkedTreeList+insertAfter"></a>
|
|
656
|
+
|
|
657
|
+
### linkedTreeList.insertAfter(node, newNode) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
440
658
|
Insert a new node (or data) after a node.
|
|
441
659
|
|
|
442
|
-
**Kind**: instance method of [<code>
|
|
443
|
-
**Overrides**: [<code>insertAfter</code>](#
|
|
660
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
661
|
+
**Overrides**: [<code>insertAfter</code>](#DoublyLinkedList+insertAfter)
|
|
444
662
|
|
|
445
663
|
| Param | Type | Description |
|
|
446
664
|
| --- | --- | --- |
|
|
447
|
-
| node | [<code>
|
|
448
|
-
| newNode | [<code>
|
|
665
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The existing node as reference |
|
|
666
|
+
| newNode | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to go after the existing node |
|
|
449
667
|
|
|
450
|
-
<a name="
|
|
668
|
+
<a name="LinkedTreeList+insertBefore"></a>
|
|
451
669
|
|
|
452
|
-
###
|
|
670
|
+
### linkedTreeList.insertBefore(node, newNode) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
453
671
|
Insert a new node (or data) before a node.
|
|
454
672
|
|
|
455
|
-
**Kind**: instance method of [<code>
|
|
456
|
-
**Overrides**: [<code>insertBefore</code>](#
|
|
673
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
674
|
+
**Overrides**: [<code>insertBefore</code>](#DoublyLinkedList+insertBefore)
|
|
457
675
|
|
|
458
676
|
| Param | Type | Description |
|
|
459
677
|
| --- | --- | --- |
|
|
460
|
-
| node | [<code>
|
|
461
|
-
| newNode | [<code>
|
|
678
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The existing node as reference |
|
|
679
|
+
| newNode | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to go before the existing node |
|
|
462
680
|
|
|
463
|
-
<a name="
|
|
681
|
+
<a name="LinkedTreeList+append"></a>
|
|
464
682
|
|
|
465
|
-
###
|
|
683
|
+
### linkedTreeList.append(node, after) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
466
684
|
Add a node (or data) after the given (or last) node in the list.
|
|
467
685
|
|
|
468
|
-
**Kind**: instance method of [<code>
|
|
469
|
-
**Overrides**: [<code>append</code>](#
|
|
686
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
687
|
+
**Overrides**: [<code>append</code>](#DoublyLinkedList+append)
|
|
470
688
|
|
|
471
689
|
| Param | Type | Description |
|
|
472
690
|
| --- | --- | --- |
|
|
473
|
-
| node | [<code>
|
|
474
|
-
| after | [<code>
|
|
691
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to add to the end of the list |
|
|
692
|
+
| after | [<code>TreeLinker</code>](#TreeLinker) | The existing last node |
|
|
475
693
|
|
|
476
|
-
<a name="
|
|
694
|
+
<a name="LinkedTreeList+prepend"></a>
|
|
477
695
|
|
|
478
|
-
###
|
|
696
|
+
### linkedTreeList.prepend(node, before) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
479
697
|
Add a node (or data) before the given (or first) node in the list.
|
|
480
698
|
|
|
481
|
-
**Kind**: instance method of [<code>
|
|
482
|
-
**Overrides**: [<code>prepend</code>](#
|
|
699
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
700
|
+
**Overrides**: [<code>prepend</code>](#DoublyLinkedList+prepend)
|
|
483
701
|
|
|
484
702
|
| Param | Type | Description |
|
|
485
703
|
| --- | --- | --- |
|
|
486
|
-
| node | [<code>
|
|
487
|
-
| before | [<code>
|
|
704
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to add to the start of the list |
|
|
705
|
+
| before | [<code>TreeLinker</code>](#TreeLinker) | The existing first node |
|
|
488
706
|
|
|
489
|
-
<a name="
|
|
707
|
+
<a name="LinkedTreeList+remove"></a>
|
|
490
708
|
|
|
491
|
-
###
|
|
709
|
+
### linkedTreeList.remove(node) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
492
710
|
Remove a linker from this linked list.
|
|
493
711
|
|
|
494
|
-
**Kind**: instance method of [<code>
|
|
495
|
-
**Overrides**: [<code>remove</code>](#
|
|
712
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
713
|
+
**Overrides**: [<code>remove</code>](#DoublyLinkedList+remove)
|
|
496
714
|
|
|
497
715
|
| Param | Type | Description |
|
|
498
716
|
| --- | --- | --- |
|
|
499
|
-
| node | [<code>
|
|
717
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) | The node we wish to remove (and it will be returned after removal) |
|
|
500
718
|
|
|
501
|
-
<a name="
|
|
719
|
+
<a name="LinkedTreeList+reset"></a>
|
|
502
720
|
|
|
503
|
-
###
|
|
721
|
+
### linkedTreeList.reset() ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
504
722
|
Refresh all references and return head reference.
|
|
505
723
|
|
|
506
|
-
**Kind**: instance method of [<code>
|
|
507
|
-
<
|
|
724
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
725
|
+
**Overrides**: [<code>reset</code>](#DoublyLinkedList+reset)
|
|
726
|
+
<a name="LinkedTreeList+item"></a>
|
|
508
727
|
|
|
509
|
-
###
|
|
510
|
-
Retrieve a
|
|
728
|
+
### linkedTreeList.item(index) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
|
|
729
|
+
Retrieve a TreeLinker item from this list by numeric index, otherwise return null.
|
|
511
730
|
|
|
512
|
-
**Kind**: instance method of [<code>
|
|
513
|
-
**Overrides**: [<code>item</code>](#
|
|
731
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
732
|
+
**Overrides**: [<code>item</code>](#DoublyLinkedList+item)
|
|
514
733
|
|
|
515
734
|
| Param | Type | Description |
|
|
516
735
|
| --- | --- | --- |
|
|
517
736
|
| index | <code>number</code> | The integer number for retrieving a node by position. |
|
|
518
737
|
|
|
519
|
-
<a name="
|
|
738
|
+
<a name="LinkedTreeList+forEach"></a>
|
|
520
739
|
|
|
521
|
-
###
|
|
522
|
-
Be able to run forEach on this
|
|
740
|
+
### linkedTreeList.forEach(callback, thisArg)
|
|
741
|
+
Be able to run forEach on this LinkedTreeList to iterate over the TreeLinker Items.
|
|
523
742
|
|
|
524
|
-
**Kind**: instance method of [<code>
|
|
525
|
-
**Overrides**: [<code>forEach</code>](#
|
|
743
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
744
|
+
**Overrides**: [<code>forEach</code>](#DoublyLinkedList+forEach)
|
|
526
745
|
|
|
527
746
|
| Param | Type | Description |
|
|
528
747
|
| --- | --- | --- |
|
|
529
|
-
| callback | <code>forEachCallback</code> | The function to call for-each
|
|
530
|
-
| thisArg | [<code>
|
|
748
|
+
| callback | <code>forEachCallback</code> | The function to call for-each tree node |
|
|
749
|
+
| thisArg | [<code>LinkedTreeList</code>](#LinkedTreeList) | Optional, 'this' reference |
|
|
750
|
+
|
|
751
|
+
<a name="Linker"></a>
|
|
752
|
+
|
|
753
|
+
## Linker ⇐ [<code>ArrayElement</code>](#ArrayElement)
|
|
754
|
+
Linker represents a node in a LinkedList.
|
|
755
|
+
|
|
756
|
+
**Kind**: global class
|
|
757
|
+
**Extends**: [<code>ArrayElement</code>](#ArrayElement)
|
|
758
|
+
|
|
759
|
+
* [Linker](#Linker) ⇐ [<code>ArrayElement</code>](#ArrayElement)
|
|
760
|
+
* [new Linker([nodeData])](#new_Linker_new)
|
|
761
|
+
* [.fromArray([values], [classType])](#Linker.fromArray) ⇒ <code>Object</code>
|
|
762
|
+
|
|
763
|
+
<a name="new_Linker_new"></a>
|
|
764
|
+
|
|
765
|
+
### new Linker([nodeData])
|
|
766
|
+
Create the new Linker instance, provide the data and optionally give the next Linker.
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
| Param | Type | Default | Description |
|
|
770
|
+
| --- | --- | --- | --- |
|
|
771
|
+
| [nodeData] | <code>Object</code> | <code>{}</code> | |
|
|
772
|
+
| [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
|
|
773
|
+
| [nodeData.next] | [<code>Linker</code>](#Linker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
|
|
774
|
+
|
|
775
|
+
<a name="Linker.fromArray"></a>
|
|
776
|
+
|
|
777
|
+
### Linker.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
778
|
+
Convert an array into Linker instances, return the head and tail Linkers.
|
|
779
|
+
|
|
780
|
+
**Kind**: static method of [<code>Linker</code>](#Linker)
|
|
781
|
+
|
|
782
|
+
| Param | Type | Default | Description |
|
|
783
|
+
| --- | --- | --- | --- |
|
|
784
|
+
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
|
|
785
|
+
| [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
|
|
531
786
|
|
|
532
787
|
<a name="LinkedList"></a>
|
|
533
788
|
|
|
@@ -686,523 +941,398 @@ Be able to run forEach on this LinkedList to iterate over the linkers.
|
|
|
686
941
|
| callback | <code>forEachCallback</code> | The function to call for-each linker |
|
|
687
942
|
| thisArg | [<code>LinkedList</code>](#LinkedList) | Optional, 'this' reference |
|
|
688
943
|
|
|
689
|
-
<a name="
|
|
690
|
-
|
|
691
|
-
## Linker ⇐ [<code>ArrayElement</code>](#ArrayElement)
|
|
692
|
-
Linker represents a node in a LinkedList.
|
|
693
|
-
|
|
694
|
-
**Kind**: global class
|
|
695
|
-
**Extends**: [<code>ArrayElement</code>](#ArrayElement)
|
|
696
|
-
|
|
697
|
-
* [Linker](#Linker) ⇐ [<code>ArrayElement</code>](#ArrayElement)
|
|
698
|
-
* [new Linker([nodeData])](#new_Linker_new)
|
|
699
|
-
* [.fromArray([values], [classType])](#Linker.fromArray) ⇒ <code>Object</code>
|
|
700
|
-
|
|
701
|
-
<a name="new_Linker_new"></a>
|
|
702
|
-
|
|
703
|
-
### new Linker([nodeData])
|
|
704
|
-
Create the new Linker instance, provide the data and optionally give the next Linker.
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
| Param | Type | Default | Description |
|
|
708
|
-
| --- | --- | --- | --- |
|
|
709
|
-
| [nodeData] | <code>Object</code> | <code>{}</code> | |
|
|
710
|
-
| [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
|
|
711
|
-
| [nodeData.next] | [<code>Linker</code>](#Linker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
|
|
712
|
-
|
|
713
|
-
<a name="Linker.fromArray"></a>
|
|
714
|
-
|
|
715
|
-
### Linker.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
716
|
-
Convert an array into Linker instances, return the head and tail Linkers.
|
|
717
|
-
|
|
718
|
-
**Kind**: static method of [<code>Linker</code>](#Linker)
|
|
719
|
-
|
|
720
|
-
| Param | Type | Default | Description |
|
|
721
|
-
| --- | --- | --- | --- |
|
|
722
|
-
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
|
|
723
|
-
| [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
|
|
724
|
-
|
|
725
|
-
<a name="LinkedTreeList"></a>
|
|
944
|
+
<a name="DoublyLinkedList"></a>
|
|
726
945
|
|
|
727
|
-
##
|
|
728
|
-
|
|
946
|
+
## DoublyLinkedList ⇐ [<code>LinkedList</code>](#LinkedList)
|
|
947
|
+
DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.
|
|
729
948
|
|
|
730
949
|
**Kind**: global class
|
|
731
|
-
**Extends**: [<code>
|
|
950
|
+
**Extends**: [<code>LinkedList</code>](#LinkedList)
|
|
732
951
|
|
|
733
|
-
* [
|
|
734
|
-
* [new
|
|
735
|
-
* [.list](#
|
|
736
|
-
* [.first](#
|
|
737
|
-
* [.last](#
|
|
738
|
-
* [.length](#
|
|
739
|
-
* [.
|
|
740
|
-
* [.
|
|
741
|
-
* [.
|
|
742
|
-
* [.
|
|
743
|
-
* [.
|
|
744
|
-
* [.
|
|
745
|
-
* [.
|
|
746
|
-
* [.
|
|
747
|
-
* [.
|
|
748
|
-
* [.remove(node)](#LinkedTreeList+remove) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
749
|
-
* [.reset()](#LinkedTreeList+reset) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
750
|
-
* [.item(index)](#LinkedTreeList+item) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
|
|
751
|
-
* [.forEach(callback, thisArg)](#LinkedTreeList+forEach)
|
|
952
|
+
* [DoublyLinkedList](#DoublyLinkedList) ⇐ [<code>LinkedList</code>](#LinkedList)
|
|
953
|
+
* [new DoublyLinkedList()](#new_DoublyLinkedList_new)
|
|
954
|
+
* [.list](#DoublyLinkedList+list) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
955
|
+
* [.first](#DoublyLinkedList+first) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
956
|
+
* [.last](#DoublyLinkedList+last) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
957
|
+
* [.length](#DoublyLinkedList+length) ⇒ <code>number</code>
|
|
958
|
+
* [.initialize(initialList)](#DoublyLinkedList+initialize) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
959
|
+
* [.insertAfter(node, newNode)](#DoublyLinkedList+insertAfter) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
960
|
+
* [.insertBefore(node, newNode)](#DoublyLinkedList+insertBefore) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
961
|
+
* [.append(node, after)](#DoublyLinkedList+append) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
962
|
+
* [.prepend(node, before)](#DoublyLinkedList+prepend) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
963
|
+
* [.remove(node)](#DoublyLinkedList+remove) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
964
|
+
* [.reset()](#DoublyLinkedList+reset) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
965
|
+
* [.item(index)](#DoublyLinkedList+item) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
966
|
+
* [.forEach(callback, thisArg)](#DoublyLinkedList+forEach)
|
|
752
967
|
|
|
753
|
-
<a name="
|
|
968
|
+
<a name="new_DoublyLinkedList_new"></a>
|
|
754
969
|
|
|
755
|
-
### new
|
|
756
|
-
Create the new
|
|
970
|
+
### new DoublyLinkedList()
|
|
971
|
+
Create the new DoublyLinkedList instance.
|
|
757
972
|
|
|
758
|
-
<a name="
|
|
973
|
+
<a name="DoublyLinkedList+list"></a>
|
|
759
974
|
|
|
760
|
-
###
|
|
975
|
+
### doublyLinkedList.list ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
761
976
|
Retrieve a copy of the innerList used.
|
|
762
977
|
|
|
763
|
-
**Kind**: instance property of [<code>
|
|
764
|
-
**Overrides**: [<code>list</code>](#
|
|
765
|
-
<a name="
|
|
766
|
-
|
|
767
|
-
### linkedTreeList.first ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
768
|
-
Retrieve the first TreeLinker in the list.
|
|
769
|
-
|
|
770
|
-
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
771
|
-
**Overrides**: [<code>first</code>](#DoublyLinkedList+first)
|
|
772
|
-
<a name="LinkedTreeList+last"></a>
|
|
773
|
-
|
|
774
|
-
### linkedTreeList.last ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
775
|
-
Retrieve the last TreeLinker in the list.
|
|
776
|
-
|
|
777
|
-
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
778
|
-
**Overrides**: [<code>last</code>](#DoublyLinkedList+last)
|
|
779
|
-
<a name="LinkedTreeList+length"></a>
|
|
780
|
-
|
|
781
|
-
### linkedTreeList.length ⇒ <code>number</code>
|
|
782
|
-
Return the length of the list.
|
|
783
|
-
|
|
784
|
-
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
785
|
-
**Overrides**: [<code>length</code>](#DoublyLinkedList+length)
|
|
786
|
-
<a name="LinkedTreeList+parent"></a>
|
|
787
|
-
|
|
788
|
-
### linkedTreeList.parent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
789
|
-
Get the parent of this tree list.
|
|
790
|
-
|
|
791
|
-
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
792
|
-
<a name="LinkedTreeList+parent"></a>
|
|
793
|
-
|
|
794
|
-
### linkedTreeList.parent
|
|
795
|
-
Set the parent of this tree list
|
|
796
|
-
|
|
797
|
-
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
798
|
-
|
|
799
|
-
| Param | Type | Description |
|
|
800
|
-
| --- | --- | --- |
|
|
801
|
-
| parent | [<code>TreeLinker</code>](#TreeLinker) | The new node to use as the parent for this group of children |
|
|
802
|
-
|
|
803
|
-
<a name="LinkedTreeList+rootParent"></a>
|
|
978
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
979
|
+
**Overrides**: [<code>list</code>](#LinkedList+list)
|
|
980
|
+
<a name="DoublyLinkedList+first"></a>
|
|
804
981
|
|
|
805
|
-
###
|
|
806
|
-
|
|
982
|
+
### doublyLinkedList.first ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
983
|
+
Retrieve the first DoubleLinker in the list.
|
|
807
984
|
|
|
808
|
-
**Kind**: instance property of [<code>
|
|
809
|
-
<
|
|
985
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
986
|
+
**Overrides**: [<code>first</code>](#LinkedList+first)
|
|
987
|
+
<a name="DoublyLinkedList+last"></a>
|
|
810
988
|
|
|
811
|
-
###
|
|
812
|
-
|
|
989
|
+
### doublyLinkedList.last ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
990
|
+
Retrieve the last DoubleLinker in the list.
|
|
813
991
|
|
|
814
|
-
**Kind**: instance
|
|
815
|
-
**Overrides**: [<code>
|
|
992
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
993
|
+
**Overrides**: [<code>last</code>](#LinkedList+last)
|
|
994
|
+
<a name="DoublyLinkedList+length"></a>
|
|
816
995
|
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
| initialList | [<code>TreeLinker</code>](#TreeLinker) | Give the list of tree-linkers to start in this linked-tree-list. |
|
|
996
|
+
### doublyLinkedList.length ⇒ <code>number</code>
|
|
997
|
+
Return the length of the list.
|
|
820
998
|
|
|
821
|
-
<
|
|
999
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1000
|
+
**Overrides**: [<code>length</code>](#LinkedList+length)
|
|
1001
|
+
<a name="DoublyLinkedList+initialize"></a>
|
|
822
1002
|
|
|
823
|
-
###
|
|
824
|
-
|
|
1003
|
+
### doublyLinkedList.initialize(initialList) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1004
|
+
Initialize the inner list, should only run once.
|
|
825
1005
|
|
|
826
|
-
**Kind**: instance method of [<code>
|
|
1006
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1007
|
+
**Overrides**: [<code>initialize</code>](#LinkedList+initialize)
|
|
827
1008
|
|
|
828
1009
|
| Param | Type | Description |
|
|
829
1010
|
| --- | --- | --- |
|
|
830
|
-
|
|
|
831
|
-
| children | [<code>LinkedTreeList</code>](#LinkedTreeList) | The LinkedTreeList which has the child nodes to use |
|
|
1011
|
+
| initialList | [<code>DoubleLinker</code>](#DoubleLinker) | Give the list of double-linkers to start in this doubly linked-list. |
|
|
832
1012
|
|
|
833
|
-
<a name="
|
|
1013
|
+
<a name="DoublyLinkedList+insertAfter"></a>
|
|
834
1014
|
|
|
835
|
-
###
|
|
1015
|
+
### doublyLinkedList.insertAfter(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
836
1016
|
Insert a new node (or data) after a node.
|
|
837
1017
|
|
|
838
|
-
**Kind**: instance method of [<code>
|
|
839
|
-
**Overrides**: [<code>insertAfter</code>](#
|
|
1018
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1019
|
+
**Overrides**: [<code>insertAfter</code>](#LinkedList+insertAfter)
|
|
840
1020
|
|
|
841
1021
|
| Param | Type | Description |
|
|
842
1022
|
| --- | --- | --- |
|
|
843
|
-
| node | [<code>
|
|
844
|
-
| newNode | [<code>
|
|
1023
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The existing node as reference |
|
|
1024
|
+
| newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to go after the existing node |
|
|
845
1025
|
|
|
846
|
-
<a name="
|
|
1026
|
+
<a name="DoublyLinkedList+insertBefore"></a>
|
|
847
1027
|
|
|
848
|
-
###
|
|
1028
|
+
### doublyLinkedList.insertBefore(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
849
1029
|
Insert a new node (or data) before a node.
|
|
850
1030
|
|
|
851
|
-
**Kind**: instance method of [<code>
|
|
852
|
-
**Overrides**: [<code>insertBefore</code>](#
|
|
1031
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1032
|
+
**Overrides**: [<code>insertBefore</code>](#LinkedList+insertBefore)
|
|
853
1033
|
|
|
854
1034
|
| Param | Type | Description |
|
|
855
1035
|
| --- | --- | --- |
|
|
856
|
-
| node | [<code>
|
|
857
|
-
| newNode | [<code>
|
|
1036
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The existing node as reference |
|
|
1037
|
+
| newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to go before the existing node |
|
|
858
1038
|
|
|
859
|
-
<a name="
|
|
1039
|
+
<a name="DoublyLinkedList+append"></a>
|
|
860
1040
|
|
|
861
|
-
###
|
|
1041
|
+
### doublyLinkedList.append(node, after) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
862
1042
|
Add a node (or data) after the given (or last) node in the list.
|
|
863
1043
|
|
|
864
|
-
**Kind**: instance method of [<code>
|
|
865
|
-
**Overrides**: [<code>append</code>](#
|
|
1044
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1045
|
+
**Overrides**: [<code>append</code>](#LinkedList+append)
|
|
866
1046
|
|
|
867
1047
|
| Param | Type | Description |
|
|
868
1048
|
| --- | --- | --- |
|
|
869
|
-
| node | [<code>
|
|
870
|
-
| after | [<code>
|
|
1049
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to add to the end of the list |
|
|
1050
|
+
| after | [<code>DoubleLinker</code>](#DoubleLinker) | The existing last node |
|
|
871
1051
|
|
|
872
|
-
<a name="
|
|
1052
|
+
<a name="DoublyLinkedList+prepend"></a>
|
|
873
1053
|
|
|
874
|
-
###
|
|
1054
|
+
### doublyLinkedList.prepend(node, before) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
875
1055
|
Add a node (or data) before the given (or first) node in the list.
|
|
876
1056
|
|
|
877
|
-
**Kind**: instance method of [<code>
|
|
878
|
-
**Overrides**: [<code>prepend</code>](#
|
|
1057
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1058
|
+
**Overrides**: [<code>prepend</code>](#LinkedList+prepend)
|
|
879
1059
|
|
|
880
1060
|
| Param | Type | Description |
|
|
881
1061
|
| --- | --- | --- |
|
|
882
|
-
| node | [<code>
|
|
883
|
-
| before | [<code>
|
|
1062
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to add to the start of the list |
|
|
1063
|
+
| before | [<code>DoubleLinker</code>](#DoubleLinker) | The existing first node |
|
|
884
1064
|
|
|
885
|
-
<a name="
|
|
1065
|
+
<a name="DoublyLinkedList+remove"></a>
|
|
886
1066
|
|
|
887
|
-
###
|
|
1067
|
+
### doublyLinkedList.remove(node) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
888
1068
|
Remove a linker from this linked list.
|
|
889
1069
|
|
|
890
|
-
**Kind**: instance method of [<code>
|
|
891
|
-
**Overrides**: [<code>remove</code>](#
|
|
1070
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1071
|
+
**Overrides**: [<code>remove</code>](#LinkedList+remove)
|
|
892
1072
|
|
|
893
1073
|
| Param | Type | Description |
|
|
894
1074
|
| --- | --- | --- |
|
|
895
|
-
| node | [<code>
|
|
1075
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) | The node we wish to remove (and it will be returned after removal) |
|
|
896
1076
|
|
|
897
|
-
<a name="
|
|
1077
|
+
<a name="DoublyLinkedList+reset"></a>
|
|
898
1078
|
|
|
899
|
-
###
|
|
1079
|
+
### doublyLinkedList.reset() ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
900
1080
|
Refresh all references and return head reference.
|
|
901
1081
|
|
|
902
|
-
**Kind**: instance method of [<code>
|
|
903
|
-
|
|
904
|
-
<a name="LinkedTreeList+item"></a>
|
|
1082
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1083
|
+
<a name="DoublyLinkedList+item"></a>
|
|
905
1084
|
|
|
906
|
-
###
|
|
907
|
-
Retrieve a
|
|
1085
|
+
### doublyLinkedList.item(index) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
1086
|
+
Retrieve a DoubleLinker item from this list by numeric index, otherwise return null.
|
|
908
1087
|
|
|
909
|
-
**Kind**: instance method of [<code>
|
|
910
|
-
**Overrides**: [<code>item</code>](#
|
|
1088
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1089
|
+
**Overrides**: [<code>item</code>](#LinkedList+item)
|
|
911
1090
|
|
|
912
1091
|
| Param | Type | Description |
|
|
913
1092
|
| --- | --- | --- |
|
|
914
1093
|
| index | <code>number</code> | The integer number for retrieving a node by position. |
|
|
915
1094
|
|
|
916
|
-
<a name="
|
|
1095
|
+
<a name="DoublyLinkedList+forEach"></a>
|
|
917
1096
|
|
|
918
|
-
###
|
|
919
|
-
Be able to run forEach on this
|
|
1097
|
+
### doublyLinkedList.forEach(callback, thisArg)
|
|
1098
|
+
Be able to run forEach on this DoublyLinkedList to iterate over the DoubleLinker Items.
|
|
920
1099
|
|
|
921
|
-
**Kind**: instance method of [<code>
|
|
922
|
-
**Overrides**: [<code>forEach</code>](#
|
|
1100
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1101
|
+
**Overrides**: [<code>forEach</code>](#LinkedList+forEach)
|
|
923
1102
|
|
|
924
1103
|
| Param | Type | Description |
|
|
925
1104
|
| --- | --- | --- |
|
|
926
|
-
| callback | <code>forEachCallback</code> | The function to call for-each
|
|
927
|
-
| thisArg | [<code>
|
|
1105
|
+
| callback | <code>forEachCallback</code> | The function to call for-each double linker |
|
|
1106
|
+
| thisArg | [<code>DoublyLinkedList</code>](#DoublyLinkedList) | Optional, 'this' reference |
|
|
928
1107
|
|
|
929
|
-
<a name="
|
|
1108
|
+
<a name="DoubleLinker"></a>
|
|
930
1109
|
|
|
931
|
-
##
|
|
932
|
-
|
|
1110
|
+
## DoubleLinker ⇐ [<code>Linker</code>](#Linker)
|
|
1111
|
+
DoubleLinker represents a node in a DoublyLinkedList which is chained by next and prev.
|
|
933
1112
|
|
|
934
1113
|
**Kind**: global class
|
|
935
|
-
**Extends**: [<code>
|
|
1114
|
+
**Extends**: [<code>Linker</code>](#Linker)
|
|
936
1115
|
|
|
937
|
-
* [
|
|
938
|
-
* [new
|
|
939
|
-
*
|
|
940
|
-
* [.childrenFromArray(children, listClass)](#TreeLinker+childrenFromArray) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
941
|
-
* _static_
|
|
942
|
-
* [.fromArray([values], [classType])](#TreeLinker.fromArray) ⇒ <code>Object</code>
|
|
1116
|
+
* [DoubleLinker](#DoubleLinker) ⇐ [<code>Linker</code>](#Linker)
|
|
1117
|
+
* [new DoubleLinker([nodeData])](#new_DoubleLinker_new)
|
|
1118
|
+
* [.fromArray([values], [classType])](#DoubleLinker.fromArray) ⇒ <code>Object</code>
|
|
943
1119
|
|
|
944
|
-
<a name="
|
|
1120
|
+
<a name="new_DoubleLinker_new"></a>
|
|
945
1121
|
|
|
946
|
-
### new
|
|
947
|
-
Create the new
|
|
1122
|
+
### new DoubleLinker([nodeData])
|
|
1123
|
+
Create the new DoubleLinker instance, provide the data and optionally the next and prev references.
|
|
948
1124
|
|
|
949
1125
|
|
|
950
1126
|
| Param | Type | Default | Description |
|
|
951
1127
|
| --- | --- | --- | --- |
|
|
952
|
-
| [
|
|
953
|
-
| [
|
|
954
|
-
| [
|
|
955
|
-
| [
|
|
956
|
-
| [settings.children] | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code></code> | The references to child linkers if any |
|
|
957
|
-
| [settings.parent] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to a parent linker if any |
|
|
958
|
-
| listClass | <code>IsArrayable.<IsTreeNode></code> | | Give the type of list to use for storing the children |
|
|
959
|
-
|
|
960
|
-
<a name="TreeLinker+childrenFromArray"></a>
|
|
961
|
-
|
|
962
|
-
### treeLinker.childrenFromArray(children, listClass) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
963
|
-
Create the children for this tree from an array.
|
|
964
|
-
|
|
965
|
-
**Kind**: instance method of [<code>TreeLinker</code>](#TreeLinker)
|
|
966
|
-
|
|
967
|
-
| Param | Type | Description |
|
|
968
|
-
| --- | --- | --- |
|
|
969
|
-
| children | <code>Array</code> \| <code>null</code> | Provide an array of data / linker references to be children of this tree node. |
|
|
970
|
-
| listClass | <code>IsArrayable.<IsTreeNode></code> | Give the type of list to use for storing the children |
|
|
1128
|
+
| [nodeData] | <code>Object</code> | <code>{}</code> | |
|
|
1129
|
+
| [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
|
|
1130
|
+
| [nodeData.next] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
|
|
1131
|
+
| [nodeData.prev] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> | The reference to the previous linker if any |
|
|
971
1132
|
|
|
972
|
-
<a name="
|
|
1133
|
+
<a name="DoubleLinker.fromArray"></a>
|
|
973
1134
|
|
|
974
|
-
###
|
|
1135
|
+
### DoubleLinker.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
975
1136
|
Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
|
|
976
1137
|
|
|
977
|
-
**Kind**: static method of [<code>
|
|
1138
|
+
**Kind**: static method of [<code>DoubleLinker</code>](#DoubleLinker)
|
|
978
1139
|
|
|
979
1140
|
| Param | Type | Default | Description |
|
|
980
1141
|
| --- | --- | --- | --- |
|
|
981
|
-
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of
|
|
982
|
-
| [classType] | <code>
|
|
1142
|
+
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
|
|
1143
|
+
| [classType] | <code>IsDoubleLinker</code> | <code>DoubleLinker</code> | Provide the type of IsDoubleLinker to use. |
|
|
983
1144
|
|
|
984
|
-
<a name="
|
|
1145
|
+
<a name="Arrayable"></a>
|
|
985
1146
|
|
|
986
|
-
##
|
|
987
|
-
|
|
1147
|
+
## Arrayable
|
|
1148
|
+
Arrayable represents a collection stored as an array.
|
|
988
1149
|
|
|
989
1150
|
**Kind**: global class
|
|
990
1151
|
|
|
991
|
-
* [
|
|
992
|
-
* [new
|
|
993
|
-
* [.
|
|
994
|
-
* [.
|
|
995
|
-
* [.
|
|
996
|
-
* [.
|
|
997
|
-
* [.
|
|
998
|
-
* [.
|
|
999
|
-
|
|
1000
|
-
<
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
| Param | Type | Description |
|
|
1007
|
-
| --- | --- | --- |
|
|
1008
|
-
| queuedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) | Give the list of queueables to start in this queue. |
|
|
1009
|
-
| listClass | <code>IsArrayable</code> | |
|
|
1010
|
-
| queueableClass | [<code>Queueable</code>](#Queueable) | |
|
|
1011
|
-
|
|
1012
|
-
<a name="Queue+dequeue"></a>
|
|
1013
|
-
|
|
1014
|
-
### queue.dequeue() ⇒ <code>completeResponse</code> \| <code>\*</code>
|
|
1015
|
-
Take a queued task from the front of the queue and run it if ready.
|
|
1016
|
-
|
|
1017
|
-
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
1018
|
-
<a name="Queue+empty"></a>
|
|
1019
|
-
|
|
1020
|
-
### queue.empty() ⇒ <code>boolean</code>
|
|
1021
|
-
Return true if the queue is empty (there are no tasks in the queue list)
|
|
1022
|
-
|
|
1023
|
-
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
1024
|
-
<a name="Queue+enqueue"></a>
|
|
1152
|
+
* [Arrayable](#Arrayable)
|
|
1153
|
+
* [new Arrayable()](#new_Arrayable_new)
|
|
1154
|
+
* [.list](#Arrayable+list) ⇒ [<code>Array.<ArrayElement></code>](#ArrayElement)
|
|
1155
|
+
* [.first](#Arrayable+first) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1156
|
+
* [.last](#Arrayable+last) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1157
|
+
* [.length](#Arrayable+length) ⇒ <code>number</code>
|
|
1158
|
+
* [.initialize(initialList)](#Arrayable+initialize) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1159
|
+
* [.insertAfter(node, newNode)](#Arrayable+insertAfter) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1160
|
+
* [.insertBefore(node, newNode)](#Arrayable+insertBefore) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1161
|
+
* [.append(node, after)](#Arrayable+append) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1162
|
+
* [.prepend(node, before)](#Arrayable+prepend) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1163
|
+
* [.remove(node)](#Arrayable+remove) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1164
|
+
* [.item(index)](#Arrayable+item) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
1165
|
+
* [.forEach(callback, thisArg)](#Arrayable+forEach) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1025
1166
|
|
|
1026
|
-
|
|
1027
|
-
Add a queued task to the end of the queue
|
|
1167
|
+
<a name="new_Arrayable_new"></a>
|
|
1028
1168
|
|
|
1029
|
-
|
|
1169
|
+
### new Arrayable()
|
|
1170
|
+
Create the new Arrayable instance, configure the Arrayable class.
|
|
1030
1171
|
|
|
1031
|
-
|
|
1032
|
-
| --- | --- | --- |
|
|
1033
|
-
| queueable | [<code>Queueable</code>](#Queueable) | Add a new queueable to the end of the queue |
|
|
1172
|
+
<a name="Arrayable+list"></a>
|
|
1034
1173
|
|
|
1035
|
-
<
|
|
1174
|
+
### arrayable.list ⇒ [<code>Array.<ArrayElement></code>](#ArrayElement)
|
|
1175
|
+
Retrieve a copy of the innerList used.
|
|
1036
1176
|
|
|
1037
|
-
|
|
1038
|
-
|
|
1177
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1178
|
+
<a name="Arrayable+first"></a>
|
|
1039
1179
|
|
|
1040
|
-
|
|
1041
|
-
|
|
1180
|
+
### arrayable.first ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1181
|
+
Retrieve the first Element from the Arrayable
|
|
1042
1182
|
|
|
1043
|
-
|
|
1044
|
-
|
|
1183
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1184
|
+
<a name="Arrayable+last"></a>
|
|
1045
1185
|
|
|
1046
|
-
|
|
1047
|
-
|
|
1186
|
+
### arrayable.last ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1187
|
+
Retrieve the last Element from the Arrayable
|
|
1048
1188
|
|
|
1049
|
-
|
|
1050
|
-
|
|
1189
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1190
|
+
<a name="Arrayable+length"></a>
|
|
1051
1191
|
|
|
1052
|
-
|
|
1053
|
-
|
|
1192
|
+
### arrayable.length ⇒ <code>number</code>
|
|
1193
|
+
Return the length of the list.
|
|
1054
1194
|
|
|
1055
|
-
|
|
1056
|
-
|
|
1195
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1196
|
+
<a name="Arrayable+initialize"></a>
|
|
1057
1197
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1198
|
+
### arrayable.initialize(initialList) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1199
|
+
Initialize the inner list, should only run once.
|
|
1060
1200
|
|
|
1061
|
-
|
|
1062
|
-
* [new Queueable([queueableData])](#new_Queueable_new)
|
|
1063
|
-
* _instance_
|
|
1064
|
-
* [.isReady](#Queueable+isReady) ⇒ <code>boolean</code>
|
|
1065
|
-
* [.task](#Queueable+task) ⇒ <code>\*</code>
|
|
1066
|
-
* [.markCompleted(completeResponse)](#Queueable+markCompleted) ⇒ <code>completeResponse</code>
|
|
1067
|
-
* [.run()](#Queueable+run) ⇒ <code>completeResponse</code>
|
|
1068
|
-
* _static_
|
|
1069
|
-
* [.fromArray(values, [classType])](#Queueable.fromArray) ⇒ <code>Object</code>
|
|
1201
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1070
1202
|
|
|
1071
|
-
|
|
1203
|
+
| Param | Type | Description |
|
|
1204
|
+
| --- | --- | --- |
|
|
1205
|
+
| initialList | [<code>Array.<ArrayElement></code>](#ArrayElement) | Give the array of elements to start in this Arrayable. |
|
|
1072
1206
|
|
|
1073
|
-
|
|
1074
|
-
Create a queueable item that can be used in a queue.
|
|
1207
|
+
<a name="Arrayable+insertAfter"></a>
|
|
1075
1208
|
|
|
1209
|
+
### arrayable.insertAfter(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1210
|
+
Insert a new node (or data) after a node.
|
|
1076
1211
|
|
|
1077
|
-
|
|
1078
|
-
| --- | --- | --- | --- |
|
|
1079
|
-
| [queueableData] | <code>Object</code> | <code>{}</code> | |
|
|
1080
|
-
| [queueableData.task] | <code>\*</code> | <code></code> | The data to be stored in this queueable |
|
|
1081
|
-
| [queueableData.next] | [<code>Queueable</code>](#Queueable) \| <code>null</code> | <code></code> | The reference to the next queueable if any |
|
|
1082
|
-
| [queueableData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Indicate if the queueable is ready to run |
|
|
1212
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1083
1213
|
|
|
1084
|
-
|
|
1214
|
+
| Param | Type | Description |
|
|
1215
|
+
| --- | --- | --- |
|
|
1216
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
|
|
1217
|
+
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go after the existing node |
|
|
1085
1218
|
|
|
1086
|
-
|
|
1087
|
-
Check ready state.
|
|
1219
|
+
<a name="Arrayable+insertBefore"></a>
|
|
1088
1220
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1221
|
+
### arrayable.insertBefore(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1222
|
+
Insert a new node (or data) before a node.
|
|
1091
1223
|
|
|
1092
|
-
|
|
1093
|
-
Retrieve the data which should be formed as a task.
|
|
1224
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1094
1225
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1226
|
+
| Param | Type | Description |
|
|
1227
|
+
| --- | --- | --- |
|
|
1228
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
|
|
1229
|
+
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go before the existing node |
|
|
1097
1230
|
|
|
1098
|
-
|
|
1099
|
-
Set this queueable as completed.
|
|
1231
|
+
<a name="Arrayable+append"></a>
|
|
1100
1232
|
|
|
1101
|
-
|
|
1233
|
+
### arrayable.append(node, after) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1234
|
+
Add a node (or data) after the given (or last) node in the list.
|
|
1102
1235
|
|
|
1103
|
-
|
|
1104
|
-
| --- | --- | --- | --- |
|
|
1105
|
-
| completeResponse | <code>Object</code> | | |
|
|
1106
|
-
| [completeResponse.success] | <code>\*</code> | <code>true</code> | Indicate when the task failed (use false) or give a success message |
|
|
1107
|
-
| [completeResponse.error] | <code>\*</code> | <code>false</code> | Indicate a task was error-free (use false) or give an error message |
|
|
1108
|
-
| [completeResponse.context] | <code>\*</code> | <code></code> | Provide additional data in the response |
|
|
1236
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1109
1237
|
|
|
1110
|
-
|
|
1238
|
+
| Param | Type | Description |
|
|
1239
|
+
| --- | --- | --- |
|
|
1240
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the end of the list |
|
|
1241
|
+
| after | [<code>ArrayElement</code>](#ArrayElement) | The existing last node |
|
|
1111
1242
|
|
|
1112
|
-
|
|
1113
|
-
Intend to run the queued task when it is ready. If ready, mark this task as running and run the task.
|
|
1243
|
+
<a name="Arrayable+prepend"></a>
|
|
1114
1244
|
|
|
1115
|
-
|
|
1116
|
-
|
|
1245
|
+
### arrayable.prepend(node, before) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1246
|
+
Add a node (or data) before the given (or first) node in the list.
|
|
1117
1247
|
|
|
1118
|
-
|
|
1119
|
-
Convert an array into Queueable instances, return the head and tail Queueables.
|
|
1248
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1120
1249
|
|
|
1121
|
-
|
|
1250
|
+
| Param | Type | Description |
|
|
1251
|
+
| --- | --- | --- |
|
|
1252
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the start of the list |
|
|
1253
|
+
| before | [<code>ArrayElement</code>](#ArrayElement) | The existing first node |
|
|
1122
1254
|
|
|
1123
|
-
|
|
1124
|
-
| --- | --- | --- | --- |
|
|
1125
|
-
| values | <code>Array</code> | | Provide an array of data that will be converted to a chain of queueable linkers. |
|
|
1126
|
-
| [classType] | <code>IsLinker</code> | <code>Queueable</code> | Provide the type of IsLinker to use. |
|
|
1255
|
+
<a name="Arrayable+remove"></a>
|
|
1127
1256
|
|
|
1128
|
-
<
|
|
1257
|
+
### arrayable.remove(node) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1258
|
+
Remove an element from this arrayable.
|
|
1129
1259
|
|
|
1130
|
-
|
|
1131
|
-
Store a collection of items which can only be inserted and removed from the top.
|
|
1260
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1132
1261
|
|
|
1133
|
-
|
|
1262
|
+
| Param | Type | Description |
|
|
1263
|
+
| --- | --- | --- |
|
|
1264
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) | The node we wish to remove (and it will be returned after removal) |
|
|
1134
1265
|
|
|
1135
|
-
|
|
1136
|
-
* [new Stack(stackedList, listClass, stackableClass)](#new_Stack_new)
|
|
1137
|
-
* [.empty()](#Stack+empty) ⇒ <code>boolean</code>
|
|
1138
|
-
* [.top()](#Stack+top) ⇒ [<code>Stackable</code>](#Stackable)
|
|
1139
|
-
* [.pop()](#Stack+pop) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
1140
|
-
* [.push(stackable)](#Stack+push)
|
|
1141
|
-
* [.remove()](#Stack+remove) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
1142
|
-
* [.size()](#Stack+size) ⇒ <code>number</code>
|
|
1266
|
+
<a name="Arrayable+item"></a>
|
|
1143
1267
|
|
|
1144
|
-
<
|
|
1268
|
+
### arrayable.item(index) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
1269
|
+
Retrieve an ArrayElement item from this list by numeric index, otherwise return null.
|
|
1145
1270
|
|
|
1146
|
-
|
|
1147
|
-
Instantiate the state with the starter stacked list.
|
|
1271
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1148
1272
|
|
|
1273
|
+
| Param | Type | Description |
|
|
1274
|
+
| --- | --- | --- |
|
|
1275
|
+
| index | <code>number</code> | The integer number for retrieving a node by position. |
|
|
1149
1276
|
|
|
1150
|
-
|
|
1151
|
-
| --- | --- |
|
|
1152
|
-
| stackedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) |
|
|
1153
|
-
| listClass | <code>IsArrayable</code> |
|
|
1154
|
-
| stackableClass | [<code>Stackable</code>](#Stackable) |
|
|
1277
|
+
<a name="Arrayable+forEach"></a>
|
|
1155
1278
|
|
|
1156
|
-
<
|
|
1279
|
+
### arrayable.forEach(callback, thisArg) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1280
|
+
Be able to run forEach on this Arrayable to iterate over the elements.
|
|
1157
1281
|
|
|
1158
|
-
|
|
1159
|
-
Return true if the stack is empty (there are no tasks in the stacked list)
|
|
1282
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1160
1283
|
|
|
1161
|
-
|
|
1162
|
-
|
|
1284
|
+
| Param | Type | Description |
|
|
1285
|
+
| --- | --- | --- |
|
|
1286
|
+
| callback | <code>forEachCallback</code> | The function to call for-each element |
|
|
1287
|
+
| thisArg | [<code>Arrayable</code>](#Arrayable) | Optional, 'this' reference |
|
|
1163
1288
|
|
|
1164
|
-
|
|
1165
|
-
Take a look at the next stacked task
|
|
1289
|
+
<a name="ArrayElement"></a>
|
|
1166
1290
|
|
|
1167
|
-
|
|
1168
|
-
|
|
1291
|
+
## ArrayElement
|
|
1292
|
+
Element represents a node in an Arrayable.
|
|
1169
1293
|
|
|
1170
|
-
|
|
1171
|
-
Remove the next stacked task and return it.
|
|
1294
|
+
**Kind**: global class
|
|
1172
1295
|
|
|
1173
|
-
|
|
1174
|
-
|
|
1296
|
+
* [ArrayElement](#ArrayElement)
|
|
1297
|
+
* [new ArrayElement([data])](#new_ArrayElement_new)
|
|
1298
|
+
* [.fromArray([values], [classType])](#ArrayElement.fromArray) ⇒ <code>Object</code>
|
|
1175
1299
|
|
|
1176
|
-
|
|
1177
|
-
Push a stackable task to the top of the stack.
|
|
1300
|
+
<a name="new_ArrayElement_new"></a>
|
|
1178
1301
|
|
|
1179
|
-
|
|
1302
|
+
### new ArrayElement([data])
|
|
1303
|
+
Create the new Element instance, provide the data and optionally configure the type of Element.
|
|
1180
1304
|
|
|
1181
|
-
| Param | Type | Description |
|
|
1182
|
-
| --- | --- | --- |
|
|
1183
|
-
| stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> | Add a new stackable to the top of the stack |
|
|
1184
1305
|
|
|
1185
|
-
|
|
1306
|
+
| Param | Type | Default | Description |
|
|
1307
|
+
| --- | --- | --- | --- |
|
|
1308
|
+
| [data] | <code>\*</code> | <code></code> | The data to be stored in this element. |
|
|
1186
1309
|
|
|
1187
|
-
|
|
1188
|
-
Remove the next stacked task and return it.
|
|
1310
|
+
<a name="ArrayElement.fromArray"></a>
|
|
1189
1311
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1312
|
+
### ArrayElement.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
1313
|
+
Convert an array into Element instances, return the head and tail Elements.
|
|
1192
1314
|
|
|
1193
|
-
|
|
1194
|
-
|
|
1315
|
+
**Kind**: static method of [<code>ArrayElement</code>](#ArrayElement)
|
|
1316
|
+
|
|
1317
|
+
| Param | Type | Default | Description |
|
|
1318
|
+
| --- | --- | --- | --- |
|
|
1319
|
+
| [values] | <code>Array.<IsElement></code> | <code>[]</code> | Provide an array of data that will be converted to array of elements. |
|
|
1320
|
+
| [classType] | <code>IsElement</code> | <code>ArrayElement</code> | Provide the type of IsElement to use. |
|
|
1195
1321
|
|
|
1196
|
-
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
1197
1322
|
<a name="Stackable"></a>
|
|
1198
1323
|
|
|
1199
|
-
## Stackable
|
|
1200
|
-
Stackable
|
|
1324
|
+
## Stackable ⇒ [<code>Stackable</code>](#Stackable)
|
|
1325
|
+
Make a new Stackable from the data given if it is not already a valid Stackable.
|
|
1201
1326
|
|
|
1202
|
-
**Kind**: global
|
|
1203
|
-
**Extends**: [<code>Linker</code>](#Linker)
|
|
1327
|
+
**Kind**: global variable
|
|
1204
1328
|
|
|
1205
|
-
|
|
1329
|
+
| Param | Type | Default | Description |
|
|
1330
|
+
| --- | --- | --- | --- |
|
|
1331
|
+
| stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> | | Return a valid Stackable instance from given data, or even an already valid one. |
|
|
1332
|
+
| [classType] | <code>IsLinker</code> | <code>Stackable</code> | Provide the type of IsLinker to use. |
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
* [Stackable](#Stackable) ⇒ [<code>Stackable</code>](#Stackable)
|
|
1206
1336
|
* [new Stackable([stackData])](#new_Stackable_new)
|
|
1207
1337
|
* _instance_
|
|
1208
1338
|
* [.task](#Stackable+task) ⇒ <code>\*</code>
|
|
@@ -1247,479 +1377,548 @@ Convert an array into Stackable instances, return the head and tail Stackables.
|
|
|
1247
1377
|
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of stackable linkers. |
|
|
1248
1378
|
| [classType] | <code>IsLinker</code> | <code>Stackable</code> | Provide the type of IsLinker to use. |
|
|
1249
1379
|
|
|
1250
|
-
<a name="
|
|
1251
|
-
|
|
1252
|
-
## ArrayIterator
|
|
1253
|
-
Class ArrayIterator returns the next value when using elements of array type list.
|
|
1254
|
-
|
|
1255
|
-
**Kind**: global class
|
|
1256
|
-
<a name="DoubleLinkerIterator"></a>
|
|
1257
|
-
|
|
1258
|
-
## DoubleLinkerIterator
|
|
1259
|
-
Class DoubleLinkerIterator returns the next value when using linkers of linked type lists.
|
|
1260
|
-
|
|
1261
|
-
**Kind**: global class
|
|
1262
|
-
<a name="LinkerIterator"></a>
|
|
1263
|
-
|
|
1264
|
-
## LinkerIterator
|
|
1265
|
-
Class LinkerIterator returns the next value when using linkers of linked type lists.
|
|
1266
|
-
|
|
1267
|
-
**Kind**: global class
|
|
1268
|
-
<a name="Runnable"></a>
|
|
1269
|
-
|
|
1270
|
-
## Runnable
|
|
1271
|
-
Identify a class that can be run.
|
|
1272
|
-
|
|
1273
|
-
**Kind**: global class
|
|
1274
|
-
|
|
1275
|
-
* [Runnable](#Runnable)
|
|
1276
|
-
* [new Runnable(data)](#new_Runnable_new)
|
|
1277
|
-
* _instance_
|
|
1278
|
-
* [.task](#Runnable+task) ⇒ <code>function</code>
|
|
1279
|
-
* [.run()](#Runnable+run) ⇒ <code>\*</code>
|
|
1280
|
-
* _static_
|
|
1281
|
-
* [.isRunnable(thing)](#Runnable.isRunnable) ⇒ <code>boolean</code>
|
|
1282
|
-
|
|
1283
|
-
<a name="new_Runnable_new"></a>
|
|
1284
|
-
|
|
1285
|
-
### new Runnable(data)
|
|
1286
|
-
Instantiate a Runnable class.
|
|
1287
|
-
|
|
1380
|
+
<a name="Stack"></a>
|
|
1288
1381
|
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
| data | <code>\*</code> |
|
|
1382
|
+
## Stack ⇒ [<code>Stack</code>](#Stack)
|
|
1383
|
+
Convert an array to a Stack.
|
|
1292
1384
|
|
|
1293
|
-
|
|
1385
|
+
**Kind**: global variable
|
|
1294
1386
|
|
|
1295
|
-
|
|
1296
|
-
|
|
1387
|
+
| Param | Type | Description |
|
|
1388
|
+
| --- | --- | --- |
|
|
1389
|
+
| values | <code>Array</code> | An array of values which will be converted to stackables in this queue |
|
|
1390
|
+
| stackableClass | [<code>Stackable</code>](#Stackable) | The class to use for each stackable |
|
|
1391
|
+
| listClass | [<code>Stack</code>](#Stack) \| <code>Iterable</code> | The class to use to manage the stackables |
|
|
1297
1392
|
|
|
1298
|
-
**Kind**: instance property of [<code>Runnable</code>](#Runnable)
|
|
1299
|
-
<a name="Runnable+run"></a>
|
|
1300
1393
|
|
|
1301
|
-
|
|
1302
|
-
|
|
1394
|
+
* [Stack](#Stack) ⇒ [<code>Stack</code>](#Stack)
|
|
1395
|
+
* [new Stack(stackedList, listClass, stackableClass)](#new_Stack_new)
|
|
1396
|
+
* [.empty()](#Stack+empty) ⇒ <code>boolean</code>
|
|
1397
|
+
* [.top()](#Stack+top) ⇒ [<code>Stackable</code>](#Stackable)
|
|
1398
|
+
* [.pop()](#Stack+pop) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
1399
|
+
* [.push(stackable)](#Stack+push)
|
|
1400
|
+
* [.remove()](#Stack+remove) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
1401
|
+
* [.size()](#Stack+size) ⇒ <code>number</code>
|
|
1303
1402
|
|
|
1304
|
-
|
|
1305
|
-
<a name="Runnable.isRunnable"></a>
|
|
1403
|
+
<a name="new_Stack_new"></a>
|
|
1306
1404
|
|
|
1307
|
-
###
|
|
1308
|
-
|
|
1405
|
+
### new Stack(stackedList, listClass, stackableClass)
|
|
1406
|
+
Instantiate the state with the starter stacked list.
|
|
1309
1407
|
|
|
1310
|
-
**Kind**: static method of [<code>Runnable</code>](#Runnable)
|
|
1311
1408
|
|
|
1312
1409
|
| Param | Type |
|
|
1313
1410
|
| --- | --- |
|
|
1314
|
-
|
|
|
1411
|
+
| stackedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) |
|
|
1412
|
+
| listClass | <code>IsArrayable</code> |
|
|
1413
|
+
| stackableClass | [<code>Stackable</code>](#Stackable) |
|
|
1315
1414
|
|
|
1316
|
-
<a name="
|
|
1415
|
+
<a name="Stack+empty"></a>
|
|
1317
1416
|
|
|
1318
|
-
|
|
1319
|
-
|
|
1417
|
+
### stack.empty() ⇒ <code>boolean</code>
|
|
1418
|
+
Return true if the stack is empty (there are no tasks in the stacked list)
|
|
1320
1419
|
|
|
1321
|
-
**Kind**:
|
|
1322
|
-
<a name="
|
|
1420
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
1421
|
+
<a name="Stack+top"></a>
|
|
1323
1422
|
|
|
1324
|
-
|
|
1325
|
-
|
|
1423
|
+
### stack.top() ⇒ [<code>Stackable</code>](#Stackable)
|
|
1424
|
+
Take a look at the next stacked task
|
|
1326
1425
|
|
|
1327
|
-
**Kind**:
|
|
1426
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
1427
|
+
<a name="Stack+pop"></a>
|
|
1328
1428
|
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
| values | <code>Array</code> | | An array of values which will be converted to elements in this arrayable |
|
|
1332
|
-
| [elementClass] | <code>IsElement</code> | <code>ArrayElement</code> | The class to use for each element |
|
|
1333
|
-
| [classType] | [<code>IsArrayable.<ArrayElement></code>](#ArrayElement) | <code>Arrayable</code> | Provide the type of IsArrayable to use. |
|
|
1429
|
+
### stack.pop() ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
1430
|
+
Remove the next stacked task and return it.
|
|
1334
1431
|
|
|
1432
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
1433
|
+
<a name="Stack+push"></a>
|
|
1335
1434
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
* [.list](#Arrayable+list) ⇒ [<code>Array.<ArrayElement></code>](#ArrayElement)
|
|
1339
|
-
* [.first](#Arrayable+first) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1340
|
-
* [.last](#Arrayable+last) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1341
|
-
* [.length](#Arrayable+length) ⇒ <code>number</code>
|
|
1342
|
-
* [.initialize(initialList)](#Arrayable+initialize) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1343
|
-
* [.insertAfter(node, newNode)](#Arrayable+insertAfter) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1344
|
-
* [.insertBefore(node, newNode)](#Arrayable+insertBefore) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1345
|
-
* [.append(node, after)](#Arrayable+append) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1346
|
-
* [.prepend(node, before)](#Arrayable+prepend) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1347
|
-
* [.remove(node)](#Arrayable+remove) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1348
|
-
* [.item(index)](#Arrayable+item) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
1349
|
-
* [.forEach(callback, thisArg)](#Arrayable+forEach) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1435
|
+
### stack.push(stackable)
|
|
1436
|
+
Push a stackable task to the top of the stack.
|
|
1350
1437
|
|
|
1351
|
-
<
|
|
1438
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
1352
1439
|
|
|
1353
|
-
|
|
1354
|
-
|
|
1440
|
+
| Param | Type | Description |
|
|
1441
|
+
| --- | --- | --- |
|
|
1442
|
+
| stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> | Add a new stackable to the top of the stack |
|
|
1355
1443
|
|
|
1356
|
-
<a name="
|
|
1444
|
+
<a name="Stack+remove"></a>
|
|
1357
1445
|
|
|
1358
|
-
###
|
|
1359
|
-
|
|
1446
|
+
### stack.remove() ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
1447
|
+
Remove the next stacked task and return it.
|
|
1360
1448
|
|
|
1361
|
-
**Kind**: instance
|
|
1362
|
-
<a name="
|
|
1449
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
1450
|
+
<a name="Stack+size"></a>
|
|
1363
1451
|
|
|
1364
|
-
###
|
|
1365
|
-
|
|
1452
|
+
### stack.size() ⇒ <code>number</code>
|
|
1453
|
+
Get the size of the current stack.
|
|
1366
1454
|
|
|
1367
|
-
**Kind**: instance
|
|
1368
|
-
<a name="
|
|
1455
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
1456
|
+
<a name="Queueable"></a>
|
|
1369
1457
|
|
|
1370
|
-
|
|
1371
|
-
|
|
1458
|
+
## Queueable ⇒ [<code>Queueable</code>](#Queueable)
|
|
1459
|
+
Make a new Queueable from the data given if it is not already a valid Queueable.
|
|
1372
1460
|
|
|
1373
|
-
**Kind**:
|
|
1374
|
-
<a name="Arrayable+length"></a>
|
|
1461
|
+
**Kind**: global variable
|
|
1375
1462
|
|
|
1376
|
-
|
|
1377
|
-
|
|
1463
|
+
| Param | Type | Default | Description |
|
|
1464
|
+
| --- | --- | --- | --- |
|
|
1465
|
+
| queueable | [<code>Queueable</code>](#Queueable) \| <code>\*</code> | | Return a valid Queueable instance from given data, or even an already valid one. |
|
|
1466
|
+
| [classType] | <code>IsLinker</code> | <code>Queueable</code> | Provide the type of IsLinker to use. |
|
|
1378
1467
|
|
|
1379
|
-
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1380
|
-
<a name="Arrayable+initialize"></a>
|
|
1381
1468
|
|
|
1382
|
-
|
|
1383
|
-
|
|
1469
|
+
* [Queueable](#Queueable) ⇒ [<code>Queueable</code>](#Queueable)
|
|
1470
|
+
* [new Queueable([queueableData])](#new_Queueable_new)
|
|
1471
|
+
* _instance_
|
|
1472
|
+
* [.isReady](#Queueable+isReady) ⇒ <code>boolean</code>
|
|
1473
|
+
* [.task](#Queueable+task) ⇒ <code>\*</code>
|
|
1474
|
+
* [.markCompleted(completeResponse)](#Queueable+markCompleted) ⇒ <code>completeResponse</code>
|
|
1475
|
+
* [.run()](#Queueable+run) ⇒ <code>completeResponse</code>
|
|
1476
|
+
* _static_
|
|
1477
|
+
* [.fromArray(values, [classType])](#Queueable.fromArray) ⇒ <code>Object</code>
|
|
1384
1478
|
|
|
1385
|
-
|
|
1479
|
+
<a name="new_Queueable_new"></a>
|
|
1386
1480
|
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
| initialList | [<code>Array.<ArrayElement></code>](#ArrayElement) | Give the array of elements to start in this Arrayable. |
|
|
1481
|
+
### new Queueable([queueableData])
|
|
1482
|
+
Create a queueable item that can be used in a queue.
|
|
1390
1483
|
|
|
1391
|
-
<a name="Arrayable+insertAfter"></a>
|
|
1392
1484
|
|
|
1393
|
-
|
|
1394
|
-
|
|
1485
|
+
| Param | Type | Default | Description |
|
|
1486
|
+
| --- | --- | --- | --- |
|
|
1487
|
+
| [queueableData] | <code>Object</code> | <code>{}</code> | |
|
|
1488
|
+
| [queueableData.task] | <code>\*</code> | <code></code> | The data to be stored in this queueable |
|
|
1489
|
+
| [queueableData.next] | [<code>Queueable</code>](#Queueable) \| <code>null</code> | <code></code> | The reference to the next queueable if any |
|
|
1490
|
+
| [queueableData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Indicate if the queueable is ready to run |
|
|
1395
1491
|
|
|
1396
|
-
|
|
1492
|
+
<a name="Queueable+isReady"></a>
|
|
1397
1493
|
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
|
|
1401
|
-
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go after the existing node |
|
|
1494
|
+
### queueable.isReady ⇒ <code>boolean</code>
|
|
1495
|
+
Check ready state.
|
|
1402
1496
|
|
|
1403
|
-
<
|
|
1497
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
1498
|
+
<a name="Queueable+task"></a>
|
|
1404
1499
|
|
|
1405
|
-
###
|
|
1406
|
-
|
|
1500
|
+
### queueable.task ⇒ <code>\*</code>
|
|
1501
|
+
Retrieve the data which should be formed as a task.
|
|
1407
1502
|
|
|
1408
|
-
**Kind**: instance
|
|
1503
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
1504
|
+
<a name="Queueable+markCompleted"></a>
|
|
1409
1505
|
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
|
|
1413
|
-
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go before the existing node |
|
|
1506
|
+
### queueable.markCompleted(completeResponse) ⇒ <code>completeResponse</code>
|
|
1507
|
+
Set this queueable as completed.
|
|
1414
1508
|
|
|
1415
|
-
<
|
|
1509
|
+
**Kind**: instance method of [<code>Queueable</code>](#Queueable)
|
|
1416
1510
|
|
|
1417
|
-
|
|
1418
|
-
|
|
1511
|
+
| Param | Type | Default | Description |
|
|
1512
|
+
| --- | --- | --- | --- |
|
|
1513
|
+
| completeResponse | <code>Object</code> | | |
|
|
1514
|
+
| [completeResponse.success] | <code>\*</code> | <code>true</code> | Indicate when the task failed (use false) or give a success message |
|
|
1515
|
+
| [completeResponse.error] | <code>\*</code> | <code>false</code> | Indicate a task was error-free (use false) or give an error message |
|
|
1516
|
+
| [completeResponse.context] | <code>\*</code> | <code></code> | Provide additional data in the response |
|
|
1419
1517
|
|
|
1420
|
-
|
|
1518
|
+
<a name="Queueable+run"></a>
|
|
1421
1519
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the end of the list |
|
|
1425
|
-
| after | [<code>ArrayElement</code>](#ArrayElement) | The existing last node |
|
|
1520
|
+
### queueable.run() ⇒ <code>completeResponse</code>
|
|
1521
|
+
Intend to run the queued task when it is ready. If ready, mark this task as running and run the task.
|
|
1426
1522
|
|
|
1427
|
-
<
|
|
1523
|
+
**Kind**: instance method of [<code>Queueable</code>](#Queueable)
|
|
1524
|
+
<a name="Queueable.fromArray"></a>
|
|
1428
1525
|
|
|
1429
|
-
###
|
|
1430
|
-
|
|
1526
|
+
### Queueable.fromArray(values, [classType]) ⇒ <code>Object</code>
|
|
1527
|
+
Convert an array into Queueable instances, return the head and tail Queueables.
|
|
1431
1528
|
|
|
1432
|
-
**Kind**:
|
|
1529
|
+
**Kind**: static method of [<code>Queueable</code>](#Queueable)
|
|
1433
1530
|
|
|
1434
|
-
| Param | Type | Description |
|
|
1435
|
-
| --- | --- | --- |
|
|
1436
|
-
|
|
|
1437
|
-
|
|
|
1531
|
+
| Param | Type | Default | Description |
|
|
1532
|
+
| --- | --- | --- | --- |
|
|
1533
|
+
| values | <code>Array</code> | | Provide an array of data that will be converted to a chain of queueable linkers. |
|
|
1534
|
+
| [classType] | <code>IsLinker</code> | <code>Queueable</code> | Provide the type of IsLinker to use. |
|
|
1438
1535
|
|
|
1439
|
-
<a name="
|
|
1536
|
+
<a name="Queue"></a>
|
|
1440
1537
|
|
|
1441
|
-
|
|
1442
|
-
|
|
1538
|
+
## Queue ⇒ [<code>Queue</code>](#Queue)
|
|
1539
|
+
Convert an array to a Queue.
|
|
1443
1540
|
|
|
1444
|
-
**Kind**:
|
|
1541
|
+
**Kind**: global variable
|
|
1445
1542
|
|
|
1446
1543
|
| Param | Type | Description |
|
|
1447
1544
|
| --- | --- | --- |
|
|
1448
|
-
|
|
|
1449
|
-
|
|
1450
|
-
<
|
|
1451
|
-
|
|
1452
|
-
### arrayable.item(index) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
1453
|
-
Retrieve an ArrayElement item from this list by numeric index, otherwise return null.
|
|
1545
|
+
| values | <code>Array</code> | An array of values which will be converted to queueables in this queue |
|
|
1546
|
+
| queueableClass | [<code>Queueable</code>](#Queueable) | The class to use for each queueable |
|
|
1547
|
+
| listClass | [<code>Queue</code>](#Queue) \| <code>Iterable</code> | The class to use to manage the queueables |
|
|
1454
1548
|
|
|
1455
|
-
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1456
1549
|
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1550
|
+
* [Queue](#Queue) ⇒ [<code>Queue</code>](#Queue)
|
|
1551
|
+
* [new Queue(queuedList, listClass, queueableClass)](#new_Queue_new)
|
|
1552
|
+
* [.dequeue()](#Queue+dequeue) ⇒ <code>completeResponse</code> \| <code>\*</code>
|
|
1553
|
+
* [.empty()](#Queue+empty) ⇒ <code>boolean</code>
|
|
1554
|
+
* [.enqueue(queueable)](#Queue+enqueue)
|
|
1555
|
+
* [.peek()](#Queue+peek) ⇒ [<code>Queueable</code>](#Queueable)
|
|
1556
|
+
* [.remove()](#Queue+remove) ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
|
|
1557
|
+
* [.size()](#Queue+size) ⇒ <code>number</code>
|
|
1460
1558
|
|
|
1461
|
-
<a name="
|
|
1559
|
+
<a name="new_Queue_new"></a>
|
|
1462
1560
|
|
|
1463
|
-
###
|
|
1464
|
-
|
|
1561
|
+
### new Queue(queuedList, listClass, queueableClass)
|
|
1562
|
+
Instantiate the queue with the given queue list.
|
|
1465
1563
|
|
|
1466
|
-
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1467
1564
|
|
|
1468
1565
|
| Param | Type | Description |
|
|
1469
1566
|
| --- | --- | --- |
|
|
1470
|
-
|
|
|
1471
|
-
|
|
|
1567
|
+
| queuedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) | Give the list of queueables to start in this queue. |
|
|
1568
|
+
| listClass | <code>IsArrayable</code> | |
|
|
1569
|
+
| queueableClass | [<code>Queueable</code>](#Queueable) | |
|
|
1472
1570
|
|
|
1473
|
-
<a name="
|
|
1571
|
+
<a name="Queue+dequeue"></a>
|
|
1474
1572
|
|
|
1475
|
-
|
|
1476
|
-
|
|
1573
|
+
### queue.dequeue() ⇒ <code>completeResponse</code> \| <code>\*</code>
|
|
1574
|
+
Take a queued task from the front of the queue and run it if ready.
|
|
1477
1575
|
|
|
1478
|
-
**Kind**:
|
|
1576
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
1577
|
+
<a name="Queue+empty"></a>
|
|
1479
1578
|
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
| element | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | | Return a valid ArrayElement instance from given data, or even an already valid one. |
|
|
1483
|
-
| [classType] | <code>IsElement</code> | <code>ArrayElement</code> | Provide the type of IsElement to use. |
|
|
1579
|
+
### queue.empty() ⇒ <code>boolean</code>
|
|
1580
|
+
Return true if the queue is empty (there are no tasks in the queue list)
|
|
1484
1581
|
|
|
1582
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
1583
|
+
<a name="Queue+enqueue"></a>
|
|
1485
1584
|
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
* [.fromArray([values], [classType])](#ArrayElement.fromArray) ⇒ <code>Object</code>
|
|
1585
|
+
### queue.enqueue(queueable)
|
|
1586
|
+
Add a queued task to the end of the queue
|
|
1489
1587
|
|
|
1490
|
-
<
|
|
1588
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
1491
1589
|
|
|
1492
|
-
|
|
1493
|
-
|
|
1590
|
+
| Param | Type | Description |
|
|
1591
|
+
| --- | --- | --- |
|
|
1592
|
+
| queueable | [<code>Queueable</code>](#Queueable) | Add a new queueable to the end of the queue |
|
|
1494
1593
|
|
|
1594
|
+
<a name="Queue+peek"></a>
|
|
1495
1595
|
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
| [data] | <code>\*</code> | <code></code> | The data to be stored in this element. |
|
|
1596
|
+
### queue.peek() ⇒ [<code>Queueable</code>](#Queueable)
|
|
1597
|
+
Take a look at the next queued task
|
|
1499
1598
|
|
|
1500
|
-
<
|
|
1599
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
1600
|
+
<a name="Queue+remove"></a>
|
|
1501
1601
|
|
|
1502
|
-
###
|
|
1503
|
-
|
|
1602
|
+
### queue.remove() ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
|
|
1603
|
+
Remove the next queued item and return it.
|
|
1504
1604
|
|
|
1505
|
-
**Kind**:
|
|
1605
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
1606
|
+
<a name="Queue+size"></a>
|
|
1506
1607
|
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
| [values] | <code>Array.<IsElement></code> | <code>[]</code> | Provide an array of data that will be converted to array of elements. |
|
|
1510
|
-
| [classType] | <code>IsElement</code> | <code>ArrayElement</code> | Provide the type of IsElement to use. |
|
|
1608
|
+
### queue.size() ⇒ <code>number</code>
|
|
1609
|
+
Get the length of the current queue.
|
|
1511
1610
|
|
|
1512
|
-
<
|
|
1611
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
1612
|
+
<a name="TreeLinker"></a>
|
|
1513
1613
|
|
|
1514
|
-
##
|
|
1614
|
+
## TreeLinker ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1515
1615
|
Make a new DoubleLinker from the data given if it is not already a valid Linker.
|
|
1516
1616
|
|
|
1517
1617
|
**Kind**: global variable
|
|
1518
1618
|
|
|
1519
1619
|
| Param | Type | Default | Description |
|
|
1520
1620
|
| --- | --- | --- | --- |
|
|
1521
|
-
| linker | [<code>
|
|
1522
|
-
| [classType] | <code>
|
|
1621
|
+
| linker | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | | Return a valid TreeLinker instance from given data, or even an already valid one. |
|
|
1622
|
+
| [classType] | <code>IsTreeNode</code> | <code>TreeLinker</code> | Provide the type of IsTreeNode to use. |
|
|
1523
1623
|
|
|
1524
1624
|
|
|
1525
|
-
* [
|
|
1526
|
-
* [new
|
|
1527
|
-
*
|
|
1625
|
+
* [TreeLinker](#TreeLinker) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1626
|
+
* [new TreeLinker([settings], listClass)](#new_TreeLinker_new)
|
|
1627
|
+
* _instance_
|
|
1628
|
+
* [.childrenFromArray(children, listClass)](#TreeLinker+childrenFromArray) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
1629
|
+
* _static_
|
|
1630
|
+
* [.fromArray([values], [classType])](#TreeLinker.fromArray) ⇒ <code>Object</code>
|
|
1528
1631
|
|
|
1529
|
-
<a name="
|
|
1632
|
+
<a name="new_TreeLinker_new"></a>
|
|
1530
1633
|
|
|
1531
|
-
### new
|
|
1532
|
-
Create the new
|
|
1634
|
+
### new TreeLinker([settings], listClass)
|
|
1635
|
+
Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.
|
|
1533
1636
|
|
|
1534
1637
|
|
|
1535
1638
|
| Param | Type | Default | Description |
|
|
1536
1639
|
| --- | --- | --- | --- |
|
|
1537
|
-
| [
|
|
1538
|
-
| [
|
|
1539
|
-
| [
|
|
1540
|
-
| [
|
|
1640
|
+
| [settings] | <code>Object</code> | <code>{}</code> | |
|
|
1641
|
+
| [settings.data] | <code>\*</code> | <code></code> | The data to be stored in this tree node |
|
|
1642
|
+
| [settings.next] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to the next linker if any |
|
|
1643
|
+
| [settings.prev] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to the previous linker if any |
|
|
1644
|
+
| [settings.children] | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code></code> | The references to child linkers if any |
|
|
1645
|
+
| [settings.parent] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to a parent linker if any |
|
|
1646
|
+
| listClass | <code>IsArrayable.<IsTreeNode></code> | | Give the type of list to use for storing the children |
|
|
1541
1647
|
|
|
1542
|
-
<a name="
|
|
1648
|
+
<a name="TreeLinker+childrenFromArray"></a>
|
|
1543
1649
|
|
|
1544
|
-
###
|
|
1650
|
+
### treeLinker.childrenFromArray(children, listClass) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
1651
|
+
Create the children for this tree from an array.
|
|
1652
|
+
|
|
1653
|
+
**Kind**: instance method of [<code>TreeLinker</code>](#TreeLinker)
|
|
1654
|
+
|
|
1655
|
+
| Param | Type | Description |
|
|
1656
|
+
| --- | --- | --- |
|
|
1657
|
+
| children | <code>Array</code> \| <code>null</code> | Provide an array of data / linker references to be children of this tree node. |
|
|
1658
|
+
| listClass | <code>IsArrayable.<IsTreeNode></code> | Give the type of list to use for storing the children |
|
|
1659
|
+
|
|
1660
|
+
<a name="TreeLinker.fromArray"></a>
|
|
1661
|
+
|
|
1662
|
+
### TreeLinker.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
1545
1663
|
Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
|
|
1546
1664
|
|
|
1547
|
-
**Kind**: static method of [<code>
|
|
1665
|
+
**Kind**: static method of [<code>TreeLinker</code>](#TreeLinker)
|
|
1548
1666
|
|
|
1549
1667
|
| Param | Type | Default | Description |
|
|
1550
1668
|
| --- | --- | --- | --- |
|
|
1551
|
-
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
|
|
1552
|
-
| [classType] | <code>
|
|
1669
|
+
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of tree-linkers. |
|
|
1670
|
+
| [classType] | <code>IsTreeNode</code> | <code>TreeLinker</code> | Provide the type of IsTreeNode to use. |
|
|
1553
1671
|
|
|
1554
|
-
<a name="
|
|
1672
|
+
<a name="LinkedTreeList"></a>
|
|
1555
1673
|
|
|
1556
|
-
##
|
|
1557
|
-
Convert an array into a
|
|
1674
|
+
## LinkedTreeList ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1675
|
+
Convert an array into a LinkedTreeList instance, return the new instance.
|
|
1558
1676
|
|
|
1559
1677
|
**Kind**: global variable
|
|
1560
1678
|
|
|
1561
1679
|
| Param | Type | Default | Description |
|
|
1562
1680
|
| --- | --- | --- | --- |
|
|
1563
|
-
| [values] | <code>Array</code> | <code>[]</code> | An array of values which will be converted to
|
|
1564
|
-
| [linkerClass] | <code>
|
|
1565
|
-
| [classType] | <code>IsArrayable.<
|
|
1681
|
+
| [values] | <code>Array</code> | <code>[]</code> | An array of values which will be converted to nodes in this tree-list |
|
|
1682
|
+
| [linkerClass] | [<code>TreeLinker</code>](#TreeLinker) | <code>TreeLinker</code> | The class to use for each node |
|
|
1683
|
+
| [classType] | [<code>IsArrayable.<TreeLinker></code>](#TreeLinker) | <code>LinkedTreeList</code> | Provide the type of IsArrayable to use. |
|
|
1566
1684
|
|
|
1567
1685
|
|
|
1568
|
-
* [
|
|
1569
|
-
* [new
|
|
1570
|
-
* [.list](#
|
|
1571
|
-
* [.first](#
|
|
1572
|
-
* [.last](#
|
|
1573
|
-
* [.length](#
|
|
1574
|
-
* [.
|
|
1575
|
-
* [.
|
|
1576
|
-
* [.
|
|
1577
|
-
* [.
|
|
1578
|
-
* [.
|
|
1579
|
-
* [.
|
|
1580
|
-
* [.
|
|
1581
|
-
* [.
|
|
1582
|
-
* [.
|
|
1686
|
+
* [LinkedTreeList](#LinkedTreeList) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1687
|
+
* [new LinkedTreeList()](#new_LinkedTreeList_new)
|
|
1688
|
+
* [.list](#LinkedTreeList+list) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1689
|
+
* [.first](#LinkedTreeList+first) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1690
|
+
* [.last](#LinkedTreeList+last) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1691
|
+
* [.length](#LinkedTreeList+length) ⇒ <code>number</code>
|
|
1692
|
+
* [.parent](#LinkedTreeList+parent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1693
|
+
* [.parent](#LinkedTreeList+parent)
|
|
1694
|
+
* [.rootParent](#LinkedTreeList+rootParent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1695
|
+
* [.initialize(initialList)](#LinkedTreeList+initialize) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1696
|
+
* [.setChildren(item, children)](#LinkedTreeList+setChildren)
|
|
1697
|
+
* [.insertAfter(node, newNode)](#LinkedTreeList+insertAfter) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1698
|
+
* [.insertBefore(node, newNode)](#LinkedTreeList+insertBefore) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1699
|
+
* [.append(node, after)](#LinkedTreeList+append) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1700
|
+
* [.prepend(node, before)](#LinkedTreeList+prepend) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1701
|
+
* [.remove(node)](#LinkedTreeList+remove) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1702
|
+
* [.reset()](#LinkedTreeList+reset) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1703
|
+
* [.item(index)](#LinkedTreeList+item) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
|
|
1704
|
+
* [.forEach(callback, thisArg)](#LinkedTreeList+forEach)
|
|
1583
1705
|
|
|
1584
|
-
<a name="
|
|
1706
|
+
<a name="new_LinkedTreeList_new"></a>
|
|
1585
1707
|
|
|
1586
|
-
### new
|
|
1587
|
-
Create the new
|
|
1708
|
+
### new LinkedTreeList()
|
|
1709
|
+
Create the new LinkedTreeList instance, configure the list class.
|
|
1588
1710
|
|
|
1589
|
-
<a name="
|
|
1711
|
+
<a name="LinkedTreeList+list"></a>
|
|
1590
1712
|
|
|
1591
|
-
###
|
|
1713
|
+
### linkedTreeList.list ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1592
1714
|
Retrieve a copy of the innerList used.
|
|
1593
1715
|
|
|
1594
|
-
**Kind**: instance property of [<code>
|
|
1595
|
-
**Overrides**: [<code>list</code>](#
|
|
1596
|
-
<a name="
|
|
1716
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1717
|
+
**Overrides**: [<code>list</code>](#DoublyLinkedList+list)
|
|
1718
|
+
<a name="LinkedTreeList+first"></a>
|
|
1597
1719
|
|
|
1598
|
-
###
|
|
1599
|
-
Retrieve the first
|
|
1720
|
+
### linkedTreeList.first ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1721
|
+
Retrieve the first TreeLinker in the list.
|
|
1600
1722
|
|
|
1601
|
-
**Kind**: instance property of [<code>
|
|
1602
|
-
**Overrides**: [<code>first</code>](#
|
|
1603
|
-
<a name="
|
|
1723
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1724
|
+
**Overrides**: [<code>first</code>](#DoublyLinkedList+first)
|
|
1725
|
+
<a name="LinkedTreeList+last"></a>
|
|
1604
1726
|
|
|
1605
|
-
###
|
|
1606
|
-
Retrieve the last
|
|
1727
|
+
### linkedTreeList.last ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1728
|
+
Retrieve the last TreeLinker in the list.
|
|
1607
1729
|
|
|
1608
|
-
**Kind**: instance property of [<code>
|
|
1609
|
-
**Overrides**: [<code>last</code>](#
|
|
1610
|
-
<a name="
|
|
1730
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1731
|
+
**Overrides**: [<code>last</code>](#DoublyLinkedList+last)
|
|
1732
|
+
<a name="LinkedTreeList+length"></a>
|
|
1611
1733
|
|
|
1612
|
-
###
|
|
1734
|
+
### linkedTreeList.length ⇒ <code>number</code>
|
|
1613
1735
|
Return the length of the list.
|
|
1614
1736
|
|
|
1615
|
-
**Kind**: instance property of [<code>
|
|
1616
|
-
**Overrides**: [<code>length</code>](#
|
|
1617
|
-
<a name="
|
|
1737
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1738
|
+
**Overrides**: [<code>length</code>](#DoublyLinkedList+length)
|
|
1739
|
+
<a name="LinkedTreeList+parent"></a>
|
|
1618
1740
|
|
|
1619
|
-
###
|
|
1741
|
+
### linkedTreeList.parent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1742
|
+
Get the parent of this tree list.
|
|
1743
|
+
|
|
1744
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1745
|
+
<a name="LinkedTreeList+parent"></a>
|
|
1746
|
+
|
|
1747
|
+
### linkedTreeList.parent
|
|
1748
|
+
Set the parent of this tree list
|
|
1749
|
+
|
|
1750
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1751
|
+
|
|
1752
|
+
| Param | Type | Description |
|
|
1753
|
+
| --- | --- | --- |
|
|
1754
|
+
| parent | [<code>TreeLinker</code>](#TreeLinker) | The new node to use as the parent for this group of children |
|
|
1755
|
+
|
|
1756
|
+
<a name="LinkedTreeList+rootParent"></a>
|
|
1757
|
+
|
|
1758
|
+
### linkedTreeList.rootParent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1759
|
+
Return the root parent of the entire tree.
|
|
1760
|
+
|
|
1761
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1762
|
+
<a name="LinkedTreeList+initialize"></a>
|
|
1763
|
+
|
|
1764
|
+
### linkedTreeList.initialize(initialList) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1620
1765
|
Initialize the inner list, should only run once.
|
|
1621
1766
|
|
|
1622
|
-
**Kind**: instance method of [<code>
|
|
1623
|
-
**Overrides**: [<code>initialize</code>](#
|
|
1767
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1768
|
+
**Overrides**: [<code>initialize</code>](#DoublyLinkedList+initialize)
|
|
1624
1769
|
|
|
1625
1770
|
| Param | Type | Description |
|
|
1626
1771
|
| --- | --- | --- |
|
|
1627
|
-
| initialList | [<code>
|
|
1772
|
+
| initialList | [<code>TreeLinker</code>](#TreeLinker) | Give the list of tree-linkers to start in this linked-tree-list. |
|
|
1628
1773
|
|
|
1629
|
-
<a name="
|
|
1774
|
+
<a name="LinkedTreeList+setChildren"></a>
|
|
1630
1775
|
|
|
1631
|
-
###
|
|
1776
|
+
### linkedTreeList.setChildren(item, children)
|
|
1777
|
+
Set the children on a parent item.
|
|
1778
|
+
|
|
1779
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1780
|
+
|
|
1781
|
+
| Param | Type | Description |
|
|
1782
|
+
| --- | --- | --- |
|
|
1783
|
+
| item | [<code>TreeLinker</code>](#TreeLinker) | The TreeLinker node that will be the parent of the children |
|
|
1784
|
+
| children | [<code>LinkedTreeList</code>](#LinkedTreeList) | The LinkedTreeList which has the child nodes to use |
|
|
1785
|
+
|
|
1786
|
+
<a name="LinkedTreeList+insertAfter"></a>
|
|
1787
|
+
|
|
1788
|
+
### linkedTreeList.insertAfter(node, newNode) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1632
1789
|
Insert a new node (or data) after a node.
|
|
1633
1790
|
|
|
1634
|
-
**Kind**: instance method of [<code>
|
|
1635
|
-
**Overrides**: [<code>insertAfter</code>](#
|
|
1791
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1792
|
+
**Overrides**: [<code>insertAfter</code>](#DoublyLinkedList+insertAfter)
|
|
1636
1793
|
|
|
1637
1794
|
| Param | Type | Description |
|
|
1638
1795
|
| --- | --- | --- |
|
|
1639
|
-
| node | [<code>
|
|
1640
|
-
| newNode | [<code>
|
|
1796
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The existing node as reference |
|
|
1797
|
+
| newNode | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to go after the existing node |
|
|
1641
1798
|
|
|
1642
|
-
<a name="
|
|
1799
|
+
<a name="LinkedTreeList+insertBefore"></a>
|
|
1643
1800
|
|
|
1644
|
-
###
|
|
1801
|
+
### linkedTreeList.insertBefore(node, newNode) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1645
1802
|
Insert a new node (or data) before a node.
|
|
1646
1803
|
|
|
1647
|
-
**Kind**: instance method of [<code>
|
|
1648
|
-
**Overrides**: [<code>insertBefore</code>](#
|
|
1804
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1805
|
+
**Overrides**: [<code>insertBefore</code>](#DoublyLinkedList+insertBefore)
|
|
1649
1806
|
|
|
1650
1807
|
| Param | Type | Description |
|
|
1651
1808
|
| --- | --- | --- |
|
|
1652
|
-
| node | [<code>
|
|
1653
|
-
| newNode | [<code>
|
|
1809
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The existing node as reference |
|
|
1810
|
+
| newNode | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to go before the existing node |
|
|
1654
1811
|
|
|
1655
|
-
<a name="
|
|
1812
|
+
<a name="LinkedTreeList+append"></a>
|
|
1656
1813
|
|
|
1657
|
-
###
|
|
1814
|
+
### linkedTreeList.append(node, after) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1658
1815
|
Add a node (or data) after the given (or last) node in the list.
|
|
1659
1816
|
|
|
1660
|
-
**Kind**: instance method of [<code>
|
|
1661
|
-
**Overrides**: [<code>append</code>](#
|
|
1817
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1818
|
+
**Overrides**: [<code>append</code>](#DoublyLinkedList+append)
|
|
1662
1819
|
|
|
1663
1820
|
| Param | Type | Description |
|
|
1664
1821
|
| --- | --- | --- |
|
|
1665
|
-
| node | [<code>
|
|
1666
|
-
| after | [<code>
|
|
1822
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to add to the end of the list |
|
|
1823
|
+
| after | [<code>TreeLinker</code>](#TreeLinker) | The existing last node |
|
|
1667
1824
|
|
|
1668
|
-
<a name="
|
|
1825
|
+
<a name="LinkedTreeList+prepend"></a>
|
|
1669
1826
|
|
|
1670
|
-
###
|
|
1827
|
+
### linkedTreeList.prepend(node, before) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1671
1828
|
Add a node (or data) before the given (or first) node in the list.
|
|
1672
1829
|
|
|
1673
|
-
**Kind**: instance method of [<code>
|
|
1674
|
-
**Overrides**: [<code>prepend</code>](#
|
|
1830
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1831
|
+
**Overrides**: [<code>prepend</code>](#DoublyLinkedList+prepend)
|
|
1675
1832
|
|
|
1676
1833
|
| Param | Type | Description |
|
|
1677
1834
|
| --- | --- | --- |
|
|
1678
|
-
| node | [<code>
|
|
1679
|
-
| before | [<code>
|
|
1835
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to add to the start of the list |
|
|
1836
|
+
| before | [<code>TreeLinker</code>](#TreeLinker) | The existing first node |
|
|
1680
1837
|
|
|
1681
|
-
<a name="
|
|
1838
|
+
<a name="LinkedTreeList+remove"></a>
|
|
1682
1839
|
|
|
1683
|
-
###
|
|
1840
|
+
### linkedTreeList.remove(node) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1684
1841
|
Remove a linker from this linked list.
|
|
1685
1842
|
|
|
1686
|
-
**Kind**: instance method of [<code>
|
|
1687
|
-
**Overrides**: [<code>remove</code>](#
|
|
1843
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1844
|
+
**Overrides**: [<code>remove</code>](#DoublyLinkedList+remove)
|
|
1688
1845
|
|
|
1689
1846
|
| Param | Type | Description |
|
|
1690
1847
|
| --- | --- | --- |
|
|
1691
|
-
| node | [<code>
|
|
1848
|
+
| node | [<code>TreeLinker</code>](#TreeLinker) | The node we wish to remove (and it will be returned after removal) |
|
|
1692
1849
|
|
|
1693
|
-
<a name="
|
|
1850
|
+
<a name="LinkedTreeList+reset"></a>
|
|
1694
1851
|
|
|
1695
|
-
###
|
|
1852
|
+
### linkedTreeList.reset() ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1696
1853
|
Refresh all references and return head reference.
|
|
1697
1854
|
|
|
1698
|
-
**Kind**: instance method of [<code>
|
|
1699
|
-
<
|
|
1855
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1856
|
+
**Overrides**: [<code>reset</code>](#DoublyLinkedList+reset)
|
|
1857
|
+
<a name="LinkedTreeList+item"></a>
|
|
1700
1858
|
|
|
1701
|
-
###
|
|
1702
|
-
Retrieve a
|
|
1859
|
+
### linkedTreeList.item(index) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
|
|
1860
|
+
Retrieve a TreeLinker item from this list by numeric index, otherwise return null.
|
|
1703
1861
|
|
|
1704
|
-
**Kind**: instance method of [<code>
|
|
1705
|
-
**Overrides**: [<code>item</code>](#
|
|
1862
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1863
|
+
**Overrides**: [<code>item</code>](#DoublyLinkedList+item)
|
|
1706
1864
|
|
|
1707
1865
|
| Param | Type | Description |
|
|
1708
1866
|
| --- | --- | --- |
|
|
1709
1867
|
| index | <code>number</code> | The integer number for retrieving a node by position. |
|
|
1710
1868
|
|
|
1711
|
-
<a name="
|
|
1869
|
+
<a name="LinkedTreeList+forEach"></a>
|
|
1712
1870
|
|
|
1713
|
-
###
|
|
1714
|
-
Be able to run forEach on this
|
|
1871
|
+
### linkedTreeList.forEach(callback, thisArg)
|
|
1872
|
+
Be able to run forEach on this LinkedTreeList to iterate over the TreeLinker Items.
|
|
1715
1873
|
|
|
1716
|
-
**Kind**: instance method of [<code>
|
|
1717
|
-
**Overrides**: [<code>forEach</code>](#
|
|
1874
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
1875
|
+
**Overrides**: [<code>forEach</code>](#DoublyLinkedList+forEach)
|
|
1718
1876
|
|
|
1719
1877
|
| Param | Type | Description |
|
|
1720
1878
|
| --- | --- | --- |
|
|
1721
|
-
| callback | <code>forEachCallback</code> | The function to call for-each
|
|
1722
|
-
| thisArg | [<code>
|
|
1879
|
+
| callback | <code>forEachCallback</code> | The function to call for-each tree node |
|
|
1880
|
+
| thisArg | [<code>LinkedTreeList</code>](#LinkedTreeList) | Optional, 'this' reference |
|
|
1881
|
+
|
|
1882
|
+
<a name="Linker"></a>
|
|
1883
|
+
|
|
1884
|
+
## Linker ⇒ [<code>Linker</code>](#Linker)
|
|
1885
|
+
Make a new Linker from the data given if it is not already a valid Linker.
|
|
1886
|
+
|
|
1887
|
+
**Kind**: global variable
|
|
1888
|
+
|
|
1889
|
+
| Param | Type | Default | Description |
|
|
1890
|
+
| --- | --- | --- | --- |
|
|
1891
|
+
| linker | [<code>Linker</code>](#Linker) \| <code>\*</code> | | Return a valid Linker instance from given data, or even an already valid one. |
|
|
1892
|
+
| [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
|
|
1893
|
+
|
|
1894
|
+
|
|
1895
|
+
* [Linker](#Linker) ⇒ [<code>Linker</code>](#Linker)
|
|
1896
|
+
* [new Linker([nodeData])](#new_Linker_new)
|
|
1897
|
+
* [.fromArray([values], [classType])](#Linker.fromArray) ⇒ <code>Object</code>
|
|
1898
|
+
|
|
1899
|
+
<a name="new_Linker_new"></a>
|
|
1900
|
+
|
|
1901
|
+
### new Linker([nodeData])
|
|
1902
|
+
Create the new Linker instance, provide the data and optionally give the next Linker.
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
| Param | Type | Default | Description |
|
|
1906
|
+
| --- | --- | --- | --- |
|
|
1907
|
+
| [nodeData] | <code>Object</code> | <code>{}</code> | |
|
|
1908
|
+
| [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
|
|
1909
|
+
| [nodeData.next] | [<code>Linker</code>](#Linker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
|
|
1910
|
+
|
|
1911
|
+
<a name="Linker.fromArray"></a>
|
|
1912
|
+
|
|
1913
|
+
### Linker.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
1914
|
+
Convert an array into Linker instances, return the head and tail Linkers.
|
|
1915
|
+
|
|
1916
|
+
**Kind**: static method of [<code>Linker</code>](#Linker)
|
|
1917
|
+
|
|
1918
|
+
| Param | Type | Default | Description |
|
|
1919
|
+
| --- | --- | --- | --- |
|
|
1920
|
+
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
|
|
1921
|
+
| [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
|
|
1723
1922
|
|
|
1724
1923
|
<a name="LinkedList"></a>
|
|
1725
1924
|
|
|
@@ -1884,631 +2083,420 @@ Be able to run forEach on this LinkedList to iterate over the linkers.
|
|
|
1884
2083
|
| callback | <code>forEachCallback</code> | The function to call for-each linker |
|
|
1885
2084
|
| thisArg | [<code>LinkedList</code>](#LinkedList) | Optional, 'this' reference |
|
|
1886
2085
|
|
|
1887
|
-
<a name="
|
|
1888
|
-
|
|
1889
|
-
## Linker ⇒ [<code>Linker</code>](#Linker)
|
|
1890
|
-
Make a new Linker from the data given if it is not already a valid Linker.
|
|
1891
|
-
|
|
1892
|
-
**Kind**: global variable
|
|
1893
|
-
|
|
1894
|
-
| Param | Type | Default | Description |
|
|
1895
|
-
| --- | --- | --- | --- |
|
|
1896
|
-
| linker | [<code>Linker</code>](#Linker) \| <code>\*</code> | | Return a valid Linker instance from given data, or even an already valid one. |
|
|
1897
|
-
| [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
* [Linker](#Linker) ⇒ [<code>Linker</code>](#Linker)
|
|
1901
|
-
* [new Linker([nodeData])](#new_Linker_new)
|
|
1902
|
-
* [.fromArray([values], [classType])](#Linker.fromArray) ⇒ <code>Object</code>
|
|
1903
|
-
|
|
1904
|
-
<a name="new_Linker_new"></a>
|
|
1905
|
-
|
|
1906
|
-
### new Linker([nodeData])
|
|
1907
|
-
Create the new Linker instance, provide the data and optionally give the next Linker.
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
| Param | Type | Default | Description |
|
|
1911
|
-
| --- | --- | --- | --- |
|
|
1912
|
-
| [nodeData] | <code>Object</code> | <code>{}</code> | |
|
|
1913
|
-
| [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
|
|
1914
|
-
| [nodeData.next] | [<code>Linker</code>](#Linker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
|
|
1915
|
-
|
|
1916
|
-
<a name="Linker.fromArray"></a>
|
|
1917
|
-
|
|
1918
|
-
### Linker.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
1919
|
-
Convert an array into Linker instances, return the head and tail Linkers.
|
|
1920
|
-
|
|
1921
|
-
**Kind**: static method of [<code>Linker</code>](#Linker)
|
|
1922
|
-
|
|
1923
|
-
| Param | Type | Default | Description |
|
|
1924
|
-
| --- | --- | --- | --- |
|
|
1925
|
-
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
|
|
1926
|
-
| [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
|
|
1927
|
-
|
|
1928
|
-
<a name="LinkedTreeList"></a>
|
|
2086
|
+
<a name="DoublyLinkedList"></a>
|
|
1929
2087
|
|
|
1930
|
-
##
|
|
1931
|
-
Convert an array into a
|
|
2088
|
+
## DoublyLinkedList ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2089
|
+
Convert an array into a DoublyLinkedList instance, return the new instance.
|
|
1932
2090
|
|
|
1933
2091
|
**Kind**: global variable
|
|
1934
2092
|
|
|
1935
2093
|
| Param | Type | Default | Description |
|
|
1936
2094
|
| --- | --- | --- | --- |
|
|
1937
|
-
| [values] | <code>Array</code> | <code>[]</code> | An array of values which will be converted to
|
|
1938
|
-
| [linkerClass] |
|
|
1939
|
-
| [classType] |
|
|
2095
|
+
| [values] | <code>Array</code> | <code>[]</code> | An array of values which will be converted to linkers in this doubly-linked-list |
|
|
2096
|
+
| [linkerClass] | <code>IsDoubleLinker</code> | <code>DoubleLinker</code> | The class to use for each linker |
|
|
2097
|
+
| [classType] | <code>IsArrayable.<IsDoubleLinker></code> | <code>LinkedList</code> | Provide the type of IsArrayable to use. |
|
|
1940
2098
|
|
|
1941
2099
|
|
|
1942
|
-
* [
|
|
1943
|
-
* [new
|
|
1944
|
-
* [.list](#
|
|
1945
|
-
* [.first](#
|
|
1946
|
-
* [.last](#
|
|
1947
|
-
* [.length](#
|
|
1948
|
-
* [.
|
|
1949
|
-
* [.
|
|
1950
|
-
* [.
|
|
1951
|
-
* [.
|
|
1952
|
-
* [.
|
|
1953
|
-
* [.
|
|
1954
|
-
* [.
|
|
1955
|
-
* [.
|
|
1956
|
-
* [.
|
|
1957
|
-
* [.remove(node)](#LinkedTreeList+remove) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1958
|
-
* [.reset()](#LinkedTreeList+reset) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1959
|
-
* [.item(index)](#LinkedTreeList+item) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
|
|
1960
|
-
* [.forEach(callback, thisArg)](#LinkedTreeList+forEach)
|
|
2100
|
+
* [DoublyLinkedList](#DoublyLinkedList) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2101
|
+
* [new DoublyLinkedList()](#new_DoublyLinkedList_new)
|
|
2102
|
+
* [.list](#DoublyLinkedList+list) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2103
|
+
* [.first](#DoublyLinkedList+first) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2104
|
+
* [.last](#DoublyLinkedList+last) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2105
|
+
* [.length](#DoublyLinkedList+length) ⇒ <code>number</code>
|
|
2106
|
+
* [.initialize(initialList)](#DoublyLinkedList+initialize) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2107
|
+
* [.insertAfter(node, newNode)](#DoublyLinkedList+insertAfter) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2108
|
+
* [.insertBefore(node, newNode)](#DoublyLinkedList+insertBefore) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2109
|
+
* [.append(node, after)](#DoublyLinkedList+append) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2110
|
+
* [.prepend(node, before)](#DoublyLinkedList+prepend) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2111
|
+
* [.remove(node)](#DoublyLinkedList+remove) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2112
|
+
* [.reset()](#DoublyLinkedList+reset) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2113
|
+
* [.item(index)](#DoublyLinkedList+item) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
2114
|
+
* [.forEach(callback, thisArg)](#DoublyLinkedList+forEach)
|
|
1961
2115
|
|
|
1962
|
-
<a name="
|
|
2116
|
+
<a name="new_DoublyLinkedList_new"></a>
|
|
1963
2117
|
|
|
1964
|
-
### new
|
|
1965
|
-
Create the new
|
|
2118
|
+
### new DoublyLinkedList()
|
|
2119
|
+
Create the new DoublyLinkedList instance.
|
|
1966
2120
|
|
|
1967
|
-
<a name="
|
|
2121
|
+
<a name="DoublyLinkedList+list"></a>
|
|
1968
2122
|
|
|
1969
|
-
###
|
|
2123
|
+
### doublyLinkedList.list ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1970
2124
|
Retrieve a copy of the innerList used.
|
|
1971
2125
|
|
|
1972
|
-
**Kind**: instance property of [<code>
|
|
1973
|
-
**Overrides**: [<code>list</code>](#
|
|
1974
|
-
<a name="
|
|
2126
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2127
|
+
**Overrides**: [<code>list</code>](#LinkedList+list)
|
|
2128
|
+
<a name="DoublyLinkedList+first"></a>
|
|
1975
2129
|
|
|
1976
|
-
###
|
|
1977
|
-
Retrieve the first
|
|
2130
|
+
### doublyLinkedList.first ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2131
|
+
Retrieve the first DoubleLinker in the list.
|
|
1978
2132
|
|
|
1979
|
-
**Kind**: instance property of [<code>
|
|
1980
|
-
**Overrides**: [<code>first</code>](#
|
|
1981
|
-
<a name="
|
|
2133
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2134
|
+
**Overrides**: [<code>first</code>](#LinkedList+first)
|
|
2135
|
+
<a name="DoublyLinkedList+last"></a>
|
|
1982
2136
|
|
|
1983
|
-
###
|
|
1984
|
-
Retrieve the last
|
|
2137
|
+
### doublyLinkedList.last ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2138
|
+
Retrieve the last DoubleLinker in the list.
|
|
1985
2139
|
|
|
1986
|
-
**Kind**: instance property of [<code>
|
|
1987
|
-
**Overrides**: [<code>last</code>](#
|
|
1988
|
-
<a name="
|
|
2140
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2141
|
+
**Overrides**: [<code>last</code>](#LinkedList+last)
|
|
2142
|
+
<a name="DoublyLinkedList+length"></a>
|
|
1989
2143
|
|
|
1990
|
-
###
|
|
2144
|
+
### doublyLinkedList.length ⇒ <code>number</code>
|
|
1991
2145
|
Return the length of the list.
|
|
1992
2146
|
|
|
1993
|
-
**Kind**: instance property of [<code>
|
|
1994
|
-
**Overrides**: [<code>length</code>](#
|
|
1995
|
-
<a name="
|
|
1996
|
-
|
|
1997
|
-
### linkedTreeList.parent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
1998
|
-
Get the parent of this tree list.
|
|
1999
|
-
|
|
2000
|
-
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
2001
|
-
<a name="LinkedTreeList+parent"></a>
|
|
2002
|
-
|
|
2003
|
-
### linkedTreeList.parent
|
|
2004
|
-
Set the parent of this tree list
|
|
2005
|
-
|
|
2006
|
-
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
2007
|
-
|
|
2008
|
-
| Param | Type | Description |
|
|
2009
|
-
| --- | --- | --- |
|
|
2010
|
-
| parent | [<code>TreeLinker</code>](#TreeLinker) | The new node to use as the parent for this group of children |
|
|
2011
|
-
|
|
2012
|
-
<a name="LinkedTreeList+rootParent"></a>
|
|
2013
|
-
|
|
2014
|
-
### linkedTreeList.rootParent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
2015
|
-
Return the root parent of the entire tree.
|
|
2016
|
-
|
|
2017
|
-
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
2018
|
-
<a name="LinkedTreeList+initialize"></a>
|
|
2019
|
-
|
|
2020
|
-
### linkedTreeList.initialize(initialList) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
2021
|
-
Initialize the inner list, should only run once.
|
|
2022
|
-
|
|
2023
|
-
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
2024
|
-
**Overrides**: [<code>initialize</code>](#DoublyLinkedList+initialize)
|
|
2025
|
-
|
|
2026
|
-
| Param | Type | Description |
|
|
2027
|
-
| --- | --- | --- |
|
|
2028
|
-
| initialList | [<code>TreeLinker</code>](#TreeLinker) | Give the list of tree-linkers to start in this linked-tree-list. |
|
|
2029
|
-
|
|
2030
|
-
<a name="LinkedTreeList+setChildren"></a>
|
|
2147
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2148
|
+
**Overrides**: [<code>length</code>](#LinkedList+length)
|
|
2149
|
+
<a name="DoublyLinkedList+initialize"></a>
|
|
2031
2150
|
|
|
2032
|
-
###
|
|
2033
|
-
|
|
2151
|
+
### doublyLinkedList.initialize(initialList) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2152
|
+
Initialize the inner list, should only run once.
|
|
2034
2153
|
|
|
2035
|
-
**Kind**: instance method of [<code>
|
|
2154
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2155
|
+
**Overrides**: [<code>initialize</code>](#LinkedList+initialize)
|
|
2036
2156
|
|
|
2037
2157
|
| Param | Type | Description |
|
|
2038
2158
|
| --- | --- | --- |
|
|
2039
|
-
|
|
|
2040
|
-
| children | [<code>LinkedTreeList</code>](#LinkedTreeList) | The LinkedTreeList which has the child nodes to use |
|
|
2159
|
+
| initialList | [<code>DoubleLinker</code>](#DoubleLinker) | Give the list of double-linkers to start in this doubly linked-list. |
|
|
2041
2160
|
|
|
2042
|
-
<a name="
|
|
2161
|
+
<a name="DoublyLinkedList+insertAfter"></a>
|
|
2043
2162
|
|
|
2044
|
-
###
|
|
2163
|
+
### doublyLinkedList.insertAfter(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2045
2164
|
Insert a new node (or data) after a node.
|
|
2046
2165
|
|
|
2047
|
-
**Kind**: instance method of [<code>
|
|
2048
|
-
**Overrides**: [<code>insertAfter</code>](#
|
|
2166
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2167
|
+
**Overrides**: [<code>insertAfter</code>](#LinkedList+insertAfter)
|
|
2049
2168
|
|
|
2050
2169
|
| Param | Type | Description |
|
|
2051
2170
|
| --- | --- | --- |
|
|
2052
|
-
| node | [<code>
|
|
2053
|
-
| newNode | [<code>
|
|
2171
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The existing node as reference |
|
|
2172
|
+
| newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to go after the existing node |
|
|
2054
2173
|
|
|
2055
|
-
<a name="
|
|
2174
|
+
<a name="DoublyLinkedList+insertBefore"></a>
|
|
2056
2175
|
|
|
2057
|
-
###
|
|
2176
|
+
### doublyLinkedList.insertBefore(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2058
2177
|
Insert a new node (or data) before a node.
|
|
2059
2178
|
|
|
2060
|
-
**Kind**: instance method of [<code>
|
|
2061
|
-
**Overrides**: [<code>insertBefore</code>](#
|
|
2179
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2180
|
+
**Overrides**: [<code>insertBefore</code>](#LinkedList+insertBefore)
|
|
2062
2181
|
|
|
2063
2182
|
| Param | Type | Description |
|
|
2064
2183
|
| --- | --- | --- |
|
|
2065
|
-
| node | [<code>
|
|
2066
|
-
| newNode | [<code>
|
|
2184
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The existing node as reference |
|
|
2185
|
+
| newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to go before the existing node |
|
|
2067
2186
|
|
|
2068
|
-
<a name="
|
|
2187
|
+
<a name="DoublyLinkedList+append"></a>
|
|
2069
2188
|
|
|
2070
|
-
###
|
|
2189
|
+
### doublyLinkedList.append(node, after) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2071
2190
|
Add a node (or data) after the given (or last) node in the list.
|
|
2072
2191
|
|
|
2073
|
-
**Kind**: instance method of [<code>
|
|
2074
|
-
**Overrides**: [<code>append</code>](#
|
|
2192
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2193
|
+
**Overrides**: [<code>append</code>](#LinkedList+append)
|
|
2075
2194
|
|
|
2076
2195
|
| Param | Type | Description |
|
|
2077
2196
|
| --- | --- | --- |
|
|
2078
|
-
| node | [<code>
|
|
2079
|
-
| after | [<code>
|
|
2197
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to add to the end of the list |
|
|
2198
|
+
| after | [<code>DoubleLinker</code>](#DoubleLinker) | The existing last node |
|
|
2080
2199
|
|
|
2081
|
-
<a name="
|
|
2200
|
+
<a name="DoublyLinkedList+prepend"></a>
|
|
2082
2201
|
|
|
2083
|
-
###
|
|
2202
|
+
### doublyLinkedList.prepend(node, before) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2084
2203
|
Add a node (or data) before the given (or first) node in the list.
|
|
2085
2204
|
|
|
2086
|
-
**Kind**: instance method of [<code>
|
|
2087
|
-
**Overrides**: [<code>prepend</code>](#
|
|
2205
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2206
|
+
**Overrides**: [<code>prepend</code>](#LinkedList+prepend)
|
|
2088
2207
|
|
|
2089
2208
|
| Param | Type | Description |
|
|
2090
2209
|
| --- | --- | --- |
|
|
2091
|
-
| node | [<code>
|
|
2092
|
-
| before | [<code>
|
|
2210
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to add to the start of the list |
|
|
2211
|
+
| before | [<code>DoubleLinker</code>](#DoubleLinker) | The existing first node |
|
|
2093
2212
|
|
|
2094
|
-
<a name="
|
|
2213
|
+
<a name="DoublyLinkedList+remove"></a>
|
|
2095
2214
|
|
|
2096
|
-
###
|
|
2215
|
+
### doublyLinkedList.remove(node) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2097
2216
|
Remove a linker from this linked list.
|
|
2098
2217
|
|
|
2099
|
-
**Kind**: instance method of [<code>
|
|
2100
|
-
**Overrides**: [<code>remove</code>](#
|
|
2218
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2219
|
+
**Overrides**: [<code>remove</code>](#LinkedList+remove)
|
|
2101
2220
|
|
|
2102
2221
|
| Param | Type | Description |
|
|
2103
2222
|
| --- | --- | --- |
|
|
2104
|
-
| node | [<code>
|
|
2223
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) | The node we wish to remove (and it will be returned after removal) |
|
|
2105
2224
|
|
|
2106
|
-
<a name="
|
|
2225
|
+
<a name="DoublyLinkedList+reset"></a>
|
|
2107
2226
|
|
|
2108
|
-
###
|
|
2227
|
+
### doublyLinkedList.reset() ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2109
2228
|
Refresh all references and return head reference.
|
|
2110
2229
|
|
|
2111
|
-
**Kind**: instance method of [<code>
|
|
2112
|
-
|
|
2113
|
-
<a name="LinkedTreeList+item"></a>
|
|
2230
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2231
|
+
<a name="DoublyLinkedList+item"></a>
|
|
2114
2232
|
|
|
2115
|
-
###
|
|
2116
|
-
Retrieve a
|
|
2233
|
+
### doublyLinkedList.item(index) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
2234
|
+
Retrieve a DoubleLinker item from this list by numeric index, otherwise return null.
|
|
2117
2235
|
|
|
2118
|
-
**Kind**: instance method of [<code>
|
|
2119
|
-
**Overrides**: [<code>item</code>](#
|
|
2236
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2237
|
+
**Overrides**: [<code>item</code>](#LinkedList+item)
|
|
2120
2238
|
|
|
2121
2239
|
| Param | Type | Description |
|
|
2122
2240
|
| --- | --- | --- |
|
|
2123
2241
|
| index | <code>number</code> | The integer number for retrieving a node by position. |
|
|
2124
2242
|
|
|
2125
|
-
<a name="
|
|
2243
|
+
<a name="DoublyLinkedList+forEach"></a>
|
|
2126
2244
|
|
|
2127
|
-
###
|
|
2128
|
-
Be able to run forEach on this
|
|
2245
|
+
### doublyLinkedList.forEach(callback, thisArg)
|
|
2246
|
+
Be able to run forEach on this DoublyLinkedList to iterate over the DoubleLinker Items.
|
|
2129
2247
|
|
|
2130
|
-
**Kind**: instance method of [<code>
|
|
2131
|
-
**Overrides**: [<code>forEach</code>](#
|
|
2248
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
2249
|
+
**Overrides**: [<code>forEach</code>](#LinkedList+forEach)
|
|
2132
2250
|
|
|
2133
2251
|
| Param | Type | Description |
|
|
2134
2252
|
| --- | --- | --- |
|
|
2135
|
-
| callback | <code>forEachCallback</code> | The function to call for-each
|
|
2136
|
-
| thisArg | [<code>
|
|
2253
|
+
| callback | <code>forEachCallback</code> | The function to call for-each double linker |
|
|
2254
|
+
| thisArg | [<code>DoublyLinkedList</code>](#DoublyLinkedList) | Optional, 'this' reference |
|
|
2137
2255
|
|
|
2138
|
-
<a name="
|
|
2256
|
+
<a name="DoubleLinker"></a>
|
|
2139
2257
|
|
|
2140
|
-
##
|
|
2258
|
+
## DoubleLinker ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2141
2259
|
Make a new DoubleLinker from the data given if it is not already a valid Linker.
|
|
2142
2260
|
|
|
2143
2261
|
**Kind**: global variable
|
|
2144
2262
|
|
|
2145
2263
|
| Param | Type | Default | Description |
|
|
2146
2264
|
| --- | --- | --- | --- |
|
|
2147
|
-
| linker | [<code>
|
|
2148
|
-
| [classType] | <code>
|
|
2265
|
+
| linker | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | | Return a valid Linker instance from given data, or even an already valid one. |
|
|
2266
|
+
| [classType] | <code>IsDoubleLinker</code> | <code>DoubleLinker</code> | Provide the type of IsDoubleLinker to use. |
|
|
2149
2267
|
|
|
2150
2268
|
|
|
2151
|
-
* [
|
|
2152
|
-
* [new
|
|
2153
|
-
*
|
|
2154
|
-
* [.childrenFromArray(children, listClass)](#TreeLinker+childrenFromArray) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
2155
|
-
* _static_
|
|
2156
|
-
* [.fromArray([values], [classType])](#TreeLinker.fromArray) ⇒ <code>Object</code>
|
|
2269
|
+
* [DoubleLinker](#DoubleLinker) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2270
|
+
* [new DoubleLinker([nodeData])](#new_DoubleLinker_new)
|
|
2271
|
+
* [.fromArray([values], [classType])](#DoubleLinker.fromArray) ⇒ <code>Object</code>
|
|
2157
2272
|
|
|
2158
|
-
<a name="
|
|
2273
|
+
<a name="new_DoubleLinker_new"></a>
|
|
2159
2274
|
|
|
2160
|
-
### new
|
|
2161
|
-
Create the new
|
|
2275
|
+
### new DoubleLinker([nodeData])
|
|
2276
|
+
Create the new DoubleLinker instance, provide the data and optionally the next and prev references.
|
|
2162
2277
|
|
|
2163
2278
|
|
|
2164
2279
|
| Param | Type | Default | Description |
|
|
2165
2280
|
| --- | --- | --- | --- |
|
|
2166
|
-
| [
|
|
2167
|
-
| [
|
|
2168
|
-
| [
|
|
2169
|
-
| [
|
|
2170
|
-
| [settings.children] | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code></code> | The references to child linkers if any |
|
|
2171
|
-
| [settings.parent] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to a parent linker if any |
|
|
2172
|
-
| listClass | <code>IsArrayable.<IsTreeNode></code> | | Give the type of list to use for storing the children |
|
|
2173
|
-
|
|
2174
|
-
<a name="TreeLinker+childrenFromArray"></a>
|
|
2175
|
-
|
|
2176
|
-
### treeLinker.childrenFromArray(children, listClass) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
2177
|
-
Create the children for this tree from an array.
|
|
2178
|
-
|
|
2179
|
-
**Kind**: instance method of [<code>TreeLinker</code>](#TreeLinker)
|
|
2180
|
-
|
|
2181
|
-
| Param | Type | Description |
|
|
2182
|
-
| --- | --- | --- |
|
|
2183
|
-
| children | <code>Array</code> \| <code>null</code> | Provide an array of data / linker references to be children of this tree node. |
|
|
2184
|
-
| listClass | <code>IsArrayable.<IsTreeNode></code> | Give the type of list to use for storing the children |
|
|
2281
|
+
| [nodeData] | <code>Object</code> | <code>{}</code> | |
|
|
2282
|
+
| [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
|
|
2283
|
+
| [nodeData.next] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
|
|
2284
|
+
| [nodeData.prev] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> | The reference to the previous linker if any |
|
|
2185
2285
|
|
|
2186
|
-
<a name="
|
|
2286
|
+
<a name="DoubleLinker.fromArray"></a>
|
|
2187
2287
|
|
|
2188
|
-
###
|
|
2288
|
+
### DoubleLinker.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
2189
2289
|
Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
|
|
2190
2290
|
|
|
2191
|
-
**Kind**: static method of [<code>
|
|
2291
|
+
**Kind**: static method of [<code>DoubleLinker</code>](#DoubleLinker)
|
|
2192
2292
|
|
|
2193
2293
|
| Param | Type | Default | Description |
|
|
2194
2294
|
| --- | --- | --- | --- |
|
|
2195
|
-
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of
|
|
2196
|
-
| [classType] | <code>
|
|
2197
|
-
|
|
2198
|
-
<a name="Queue"></a>
|
|
2199
|
-
|
|
2200
|
-
## Queue ⇒ [<code>Queue</code>](#Queue)
|
|
2201
|
-
Convert an array to a Queue.
|
|
2202
|
-
|
|
2203
|
-
**Kind**: global variable
|
|
2204
|
-
|
|
2205
|
-
| Param | Type | Description |
|
|
2206
|
-
| --- | --- | --- |
|
|
2207
|
-
| values | <code>Array</code> | An array of values which will be converted to queueables in this queue |
|
|
2208
|
-
| queueableClass | [<code>Queueable</code>](#Queueable) | The class to use for each queueable |
|
|
2209
|
-
| listClass | [<code>Queue</code>](#Queue) \| <code>Iterable</code> | The class to use to manage the queueables |
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
* [Queue](#Queue) ⇒ [<code>Queue</code>](#Queue)
|
|
2213
|
-
* [new Queue(queuedList, listClass, queueableClass)](#new_Queue_new)
|
|
2214
|
-
* [.dequeue()](#Queue+dequeue) ⇒ <code>completeResponse</code> \| <code>\*</code>
|
|
2215
|
-
* [.empty()](#Queue+empty) ⇒ <code>boolean</code>
|
|
2216
|
-
* [.enqueue(queueable)](#Queue+enqueue)
|
|
2217
|
-
* [.peek()](#Queue+peek) ⇒ [<code>Queueable</code>](#Queueable)
|
|
2218
|
-
* [.remove()](#Queue+remove) ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
|
|
2219
|
-
* [.size()](#Queue+size) ⇒ <code>number</code>
|
|
2220
|
-
|
|
2221
|
-
<a name="new_Queue_new"></a>
|
|
2222
|
-
|
|
2223
|
-
### new Queue(queuedList, listClass, queueableClass)
|
|
2224
|
-
Instantiate the queue with the given queue list.
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
| Param | Type | Description |
|
|
2228
|
-
| --- | --- | --- |
|
|
2229
|
-
| queuedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) | Give the list of queueables to start in this queue. |
|
|
2230
|
-
| listClass | <code>IsArrayable</code> | |
|
|
2231
|
-
| queueableClass | [<code>Queueable</code>](#Queueable) | |
|
|
2232
|
-
|
|
2233
|
-
<a name="Queue+dequeue"></a>
|
|
2234
|
-
|
|
2235
|
-
### queue.dequeue() ⇒ <code>completeResponse</code> \| <code>\*</code>
|
|
2236
|
-
Take a queued task from the front of the queue and run it if ready.
|
|
2237
|
-
|
|
2238
|
-
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
2239
|
-
<a name="Queue+empty"></a>
|
|
2240
|
-
|
|
2241
|
-
### queue.empty() ⇒ <code>boolean</code>
|
|
2242
|
-
Return true if the queue is empty (there are no tasks in the queue list)
|
|
2243
|
-
|
|
2244
|
-
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
2245
|
-
<a name="Queue+enqueue"></a>
|
|
2246
|
-
|
|
2247
|
-
### queue.enqueue(queueable)
|
|
2248
|
-
Add a queued task to the end of the queue
|
|
2249
|
-
|
|
2250
|
-
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
2251
|
-
|
|
2252
|
-
| Param | Type | Description |
|
|
2253
|
-
| --- | --- | --- |
|
|
2254
|
-
| queueable | [<code>Queueable</code>](#Queueable) | Add a new queueable to the end of the queue |
|
|
2255
|
-
|
|
2256
|
-
<a name="Queue+peek"></a>
|
|
2257
|
-
|
|
2258
|
-
### queue.peek() ⇒ [<code>Queueable</code>](#Queueable)
|
|
2259
|
-
Take a look at the next queued task
|
|
2260
|
-
|
|
2261
|
-
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
2262
|
-
<a name="Queue+remove"></a>
|
|
2263
|
-
|
|
2264
|
-
### queue.remove() ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
|
|
2265
|
-
Remove the next queued item and return it.
|
|
2266
|
-
|
|
2267
|
-
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
2268
|
-
<a name="Queue+size"></a>
|
|
2269
|
-
|
|
2270
|
-
### queue.size() ⇒ <code>number</code>
|
|
2271
|
-
Get the length of the current queue.
|
|
2295
|
+
| [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
|
|
2296
|
+
| [classType] | <code>IsDoubleLinker</code> | <code>DoubleLinker</code> | Provide the type of IsDoubleLinker to use. |
|
|
2272
2297
|
|
|
2273
|
-
|
|
2274
|
-
<a name="Queueable"></a>
|
|
2298
|
+
<a name="Arrayable"></a>
|
|
2275
2299
|
|
|
2276
|
-
##
|
|
2277
|
-
|
|
2300
|
+
## Arrayable ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2301
|
+
Convert an array to an Arrayable.
|
|
2278
2302
|
|
|
2279
2303
|
**Kind**: global variable
|
|
2280
2304
|
|
|
2281
2305
|
| Param | Type | Default | Description |
|
|
2282
2306
|
| --- | --- | --- | --- |
|
|
2283
|
-
|
|
|
2284
|
-
| [
|
|
2307
|
+
| values | <code>Array</code> | | An array of values which will be converted to elements in this arrayable |
|
|
2308
|
+
| [elementClass] | <code>IsElement</code> | <code>ArrayElement</code> | The class to use for each element |
|
|
2309
|
+
| [classType] | [<code>IsArrayable.<ArrayElement></code>](#ArrayElement) | <code>Arrayable</code> | Provide the type of IsArrayable to use. |
|
|
2285
2310
|
|
|
2286
2311
|
|
|
2287
|
-
* [
|
|
2288
|
-
* [new
|
|
2289
|
-
*
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
*
|
|
2295
|
-
|
|
2312
|
+
* [Arrayable](#Arrayable) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2313
|
+
* [new Arrayable()](#new_Arrayable_new)
|
|
2314
|
+
* [.list](#Arrayable+list) ⇒ [<code>Array.<ArrayElement></code>](#ArrayElement)
|
|
2315
|
+
* [.first](#Arrayable+first) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
2316
|
+
* [.last](#Arrayable+last) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
2317
|
+
* [.length](#Arrayable+length) ⇒ <code>number</code>
|
|
2318
|
+
* [.initialize(initialList)](#Arrayable+initialize) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2319
|
+
* [.insertAfter(node, newNode)](#Arrayable+insertAfter) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2320
|
+
* [.insertBefore(node, newNode)](#Arrayable+insertBefore) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2321
|
+
* [.append(node, after)](#Arrayable+append) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2322
|
+
* [.prepend(node, before)](#Arrayable+prepend) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2323
|
+
* [.remove(node)](#Arrayable+remove) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
2324
|
+
* [.item(index)](#Arrayable+item) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
2325
|
+
* [.forEach(callback, thisArg)](#Arrayable+forEach) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2296
2326
|
|
|
2297
|
-
<a name="
|
|
2327
|
+
<a name="new_Arrayable_new"></a>
|
|
2298
2328
|
|
|
2299
|
-
### new
|
|
2300
|
-
Create
|
|
2329
|
+
### new Arrayable()
|
|
2330
|
+
Create the new Arrayable instance, configure the Arrayable class.
|
|
2301
2331
|
|
|
2332
|
+
<a name="Arrayable+list"></a>
|
|
2302
2333
|
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
| [queueableData] | <code>Object</code> | <code>{}</code> | |
|
|
2306
|
-
| [queueableData.task] | <code>\*</code> | <code></code> | The data to be stored in this queueable |
|
|
2307
|
-
| [queueableData.next] | [<code>Queueable</code>](#Queueable) \| <code>null</code> | <code></code> | The reference to the next queueable if any |
|
|
2308
|
-
| [queueableData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Indicate if the queueable is ready to run |
|
|
2334
|
+
### arrayable.list ⇒ [<code>Array.<ArrayElement></code>](#ArrayElement)
|
|
2335
|
+
Retrieve a copy of the innerList used.
|
|
2309
2336
|
|
|
2310
|
-
<
|
|
2337
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
2338
|
+
<a name="Arrayable+first"></a>
|
|
2311
2339
|
|
|
2312
|
-
###
|
|
2313
|
-
|
|
2340
|
+
### arrayable.first ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
2341
|
+
Retrieve the first Element from the Arrayable
|
|
2314
2342
|
|
|
2315
|
-
**Kind**: instance property of [<code>
|
|
2316
|
-
<a name="
|
|
2343
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
2344
|
+
<a name="Arrayable+last"></a>
|
|
2317
2345
|
|
|
2318
|
-
###
|
|
2319
|
-
Retrieve the
|
|
2346
|
+
### arrayable.last ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
2347
|
+
Retrieve the last Element from the Arrayable
|
|
2320
2348
|
|
|
2321
|
-
**Kind**: instance property of [<code>
|
|
2322
|
-
<a name="
|
|
2349
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
2350
|
+
<a name="Arrayable+length"></a>
|
|
2323
2351
|
|
|
2324
|
-
###
|
|
2325
|
-
|
|
2352
|
+
### arrayable.length ⇒ <code>number</code>
|
|
2353
|
+
Return the length of the list.
|
|
2326
2354
|
|
|
2327
|
-
**Kind**: instance
|
|
2355
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
2356
|
+
<a name="Arrayable+initialize"></a>
|
|
2328
2357
|
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
| completeResponse | <code>Object</code> | | |
|
|
2332
|
-
| [completeResponse.success] | <code>\*</code> | <code>true</code> | Indicate when the task failed (use false) or give a success message |
|
|
2333
|
-
| [completeResponse.error] | <code>\*</code> | <code>false</code> | Indicate a task was error-free (use false) or give an error message |
|
|
2334
|
-
| [completeResponse.context] | <code>\*</code> | <code></code> | Provide additional data in the response |
|
|
2358
|
+
### arrayable.initialize(initialList) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2359
|
+
Initialize the inner list, should only run once.
|
|
2335
2360
|
|
|
2336
|
-
<
|
|
2361
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
2337
2362
|
|
|
2338
|
-
|
|
2339
|
-
|
|
2363
|
+
| Param | Type | Description |
|
|
2364
|
+
| --- | --- | --- |
|
|
2365
|
+
| initialList | [<code>Array.<ArrayElement></code>](#ArrayElement) | Give the array of elements to start in this Arrayable. |
|
|
2340
2366
|
|
|
2341
|
-
|
|
2342
|
-
<a name="Queueable.fromArray"></a>
|
|
2367
|
+
<a name="Arrayable+insertAfter"></a>
|
|
2343
2368
|
|
|
2344
|
-
###
|
|
2345
|
-
|
|
2369
|
+
### arrayable.insertAfter(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2370
|
+
Insert a new node (or data) after a node.
|
|
2346
2371
|
|
|
2347
|
-
**Kind**:
|
|
2372
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
2348
2373
|
|
|
2349
|
-
| Param | Type |
|
|
2350
|
-
| --- | --- | --- |
|
|
2351
|
-
|
|
|
2352
|
-
|
|
|
2374
|
+
| Param | Type | Description |
|
|
2375
|
+
| --- | --- | --- |
|
|
2376
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
|
|
2377
|
+
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go after the existing node |
|
|
2353
2378
|
|
|
2354
|
-
<a name="
|
|
2379
|
+
<a name="Arrayable+insertBefore"></a>
|
|
2355
2380
|
|
|
2356
|
-
|
|
2357
|
-
|
|
2381
|
+
### arrayable.insertBefore(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2382
|
+
Insert a new node (or data) before a node.
|
|
2358
2383
|
|
|
2359
|
-
**Kind**:
|
|
2384
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
2360
2385
|
|
|
2361
2386
|
| Param | Type | Description |
|
|
2362
2387
|
| --- | --- | --- |
|
|
2363
|
-
|
|
|
2364
|
-
|
|
|
2365
|
-
| listClass | [<code>Stack</code>](#Stack) \| <code>Iterable</code> | The class to use to manage the stackables |
|
|
2388
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
|
|
2389
|
+
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go before the existing node |
|
|
2366
2390
|
|
|
2391
|
+
<a name="Arrayable+append"></a>
|
|
2367
2392
|
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
* [.empty()](#Stack+empty) ⇒ <code>boolean</code>
|
|
2371
|
-
* [.top()](#Stack+top) ⇒ [<code>Stackable</code>](#Stackable)
|
|
2372
|
-
* [.pop()](#Stack+pop) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
2373
|
-
* [.push(stackable)](#Stack+push)
|
|
2374
|
-
* [.remove()](#Stack+remove) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
2375
|
-
* [.size()](#Stack+size) ⇒ <code>number</code>
|
|
2393
|
+
### arrayable.append(node, after) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2394
|
+
Add a node (or data) after the given (or last) node in the list.
|
|
2376
2395
|
|
|
2377
|
-
<
|
|
2396
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
2378
2397
|
|
|
2379
|
-
|
|
2380
|
-
|
|
2398
|
+
| Param | Type | Description |
|
|
2399
|
+
| --- | --- | --- |
|
|
2400
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the end of the list |
|
|
2401
|
+
| after | [<code>ArrayElement</code>](#ArrayElement) | The existing last node |
|
|
2381
2402
|
|
|
2403
|
+
<a name="Arrayable+prepend"></a>
|
|
2382
2404
|
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
| stackedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) |
|
|
2386
|
-
| listClass | <code>IsArrayable</code> |
|
|
2387
|
-
| stackableClass | [<code>Stackable</code>](#Stackable) |
|
|
2405
|
+
### arrayable.prepend(node, before) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2406
|
+
Add a node (or data) before the given (or first) node in the list.
|
|
2388
2407
|
|
|
2389
|
-
<
|
|
2408
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
2390
2409
|
|
|
2391
|
-
|
|
2392
|
-
|
|
2410
|
+
| Param | Type | Description |
|
|
2411
|
+
| --- | --- | --- |
|
|
2412
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the start of the list |
|
|
2413
|
+
| before | [<code>ArrayElement</code>](#ArrayElement) | The existing first node |
|
|
2393
2414
|
|
|
2394
|
-
|
|
2395
|
-
<a name="Stack+top"></a>
|
|
2415
|
+
<a name="Arrayable+remove"></a>
|
|
2396
2416
|
|
|
2397
|
-
###
|
|
2398
|
-
|
|
2417
|
+
### arrayable.remove(node) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
2418
|
+
Remove an element from this arrayable.
|
|
2399
2419
|
|
|
2400
|
-
**Kind**: instance method of [<code>
|
|
2401
|
-
<a name="Stack+pop"></a>
|
|
2420
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
2402
2421
|
|
|
2403
|
-
|
|
2404
|
-
|
|
2422
|
+
| Param | Type | Description |
|
|
2423
|
+
| --- | --- | --- |
|
|
2424
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) | The node we wish to remove (and it will be returned after removal) |
|
|
2405
2425
|
|
|
2406
|
-
|
|
2407
|
-
<a name="Stack+push"></a>
|
|
2426
|
+
<a name="Arrayable+item"></a>
|
|
2408
2427
|
|
|
2409
|
-
###
|
|
2410
|
-
|
|
2428
|
+
### arrayable.item(index) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
2429
|
+
Retrieve an ArrayElement item from this list by numeric index, otherwise return null.
|
|
2411
2430
|
|
|
2412
|
-
**Kind**: instance method of [<code>
|
|
2431
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
2413
2432
|
|
|
2414
2433
|
| Param | Type | Description |
|
|
2415
2434
|
| --- | --- | --- |
|
|
2416
|
-
|
|
|
2435
|
+
| index | <code>number</code> | The integer number for retrieving a node by position. |
|
|
2417
2436
|
|
|
2418
|
-
<a name="
|
|
2437
|
+
<a name="Arrayable+forEach"></a>
|
|
2419
2438
|
|
|
2420
|
-
###
|
|
2421
|
-
|
|
2439
|
+
### arrayable.forEach(callback, thisArg) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
2440
|
+
Be able to run forEach on this Arrayable to iterate over the elements.
|
|
2422
2441
|
|
|
2423
|
-
**Kind**: instance method of [<code>
|
|
2424
|
-
<a name="Stack+size"></a>
|
|
2442
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
2425
2443
|
|
|
2426
|
-
|
|
2427
|
-
|
|
2444
|
+
| Param | Type | Description |
|
|
2445
|
+
| --- | --- | --- |
|
|
2446
|
+
| callback | <code>forEachCallback</code> | The function to call for-each element |
|
|
2447
|
+
| thisArg | [<code>Arrayable</code>](#Arrayable) | Optional, 'this' reference |
|
|
2428
2448
|
|
|
2429
|
-
|
|
2430
|
-
<a name="Stackable"></a>
|
|
2449
|
+
<a name="ArrayElement"></a>
|
|
2431
2450
|
|
|
2432
|
-
##
|
|
2433
|
-
Make a new
|
|
2451
|
+
## ArrayElement ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
2452
|
+
Make a new Element from the data given if it is not already a valid Element.
|
|
2434
2453
|
|
|
2435
2454
|
**Kind**: global variable
|
|
2436
2455
|
|
|
2437
2456
|
| Param | Type | Default | Description |
|
|
2438
2457
|
| --- | --- | --- | --- |
|
|
2439
|
-
|
|
|
2440
|
-
| [classType] | <code>
|
|
2458
|
+
| element | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | | Return a valid ArrayElement instance from given data, or even an already valid one. |
|
|
2459
|
+
| [classType] | <code>IsElement</code> | <code>ArrayElement</code> | Provide the type of IsElement to use. |
|
|
2441
2460
|
|
|
2442
2461
|
|
|
2443
|
-
* [
|
|
2444
|
-
* [new
|
|
2445
|
-
*
|
|
2446
|
-
* [.task](#Stackable+task) ⇒ <code>\*</code>
|
|
2447
|
-
* [.run()](#Stackable+run) ⇒ <code>\*</code>
|
|
2448
|
-
* _static_
|
|
2449
|
-
* [.fromArray([values], [classType])](#Stackable.fromArray) ⇒ <code>Object</code>
|
|
2462
|
+
* [ArrayElement](#ArrayElement) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
2463
|
+
* [new ArrayElement([data])](#new_ArrayElement_new)
|
|
2464
|
+
* [.fromArray([values], [classType])](#ArrayElement.fromArray) ⇒ <code>Object</code>
|
|
2450
2465
|
|
|
2451
|
-
<a name="
|
|
2466
|
+
<a name="new_ArrayElement_new"></a>
|
|
2452
2467
|
|
|
2453
|
-
### new
|
|
2454
|
-
Create
|
|
2468
|
+
### new ArrayElement([data])
|
|
2469
|
+
Create the new Element instance, provide the data and optionally configure the type of Element.
|
|
2455
2470
|
|
|
2456
2471
|
|
|
2457
2472
|
| Param | Type | Default | Description |
|
|
2458
2473
|
| --- | --- | --- | --- |
|
|
2459
|
-
| [
|
|
2460
|
-
| [stackData.task] | <code>\*</code> | <code></code> | The data to be stored in this stackable |
|
|
2461
|
-
| [stackData.next] | [<code>Stackable</code>](#Stackable) \| <code>null</code> | <code></code> | The reference to the next stackable if any |
|
|
2462
|
-
| [stackData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Indicate if the stackable is ready to run |
|
|
2463
|
-
|
|
2464
|
-
<a name="Stackable+task"></a>
|
|
2465
|
-
|
|
2466
|
-
### stackable.task ⇒ <code>\*</code>
|
|
2467
|
-
Retrieve the data which should be formed as a task.
|
|
2468
|
-
|
|
2469
|
-
**Kind**: instance property of [<code>Stackable</code>](#Stackable)
|
|
2470
|
-
<a name="Stackable+run"></a>
|
|
2471
|
-
|
|
2472
|
-
### stackable.run() ⇒ <code>\*</code>
|
|
2473
|
-
Run the stacked task.
|
|
2474
|
+
| [data] | <code>\*</code> | <code></code> | The data to be stored in this element. |
|
|
2474
2475
|
|
|
2475
|
-
|
|
2476
|
-
<a name="Stackable.fromArray"></a>
|
|
2476
|
+
<a name="ArrayElement.fromArray"></a>
|
|
2477
2477
|
|
|
2478
|
-
###
|
|
2479
|
-
Convert an array into
|
|
2478
|
+
### ArrayElement.fromArray([values], [classType]) ⇒ <code>Object</code>
|
|
2479
|
+
Convert an array into Element instances, return the head and tail Elements.
|
|
2480
2480
|
|
|
2481
|
-
**Kind**: static method of [<code>
|
|
2481
|
+
**Kind**: static method of [<code>ArrayElement</code>](#ArrayElement)
|
|
2482
2482
|
|
|
2483
2483
|
| Param | Type | Default | Description |
|
|
2484
2484
|
| --- | --- | --- | --- |
|
|
2485
|
-
| [values] | <code>Array
|
|
2486
|
-
| [classType] | <code>
|
|
2487
|
-
|
|
2488
|
-
<a name="recipes"></a>
|
|
2489
|
-
|
|
2490
|
-
## recipes
|
|
2491
|
-
List of class declarations that can be used to specify attributes for a style of object / class.
|
|
2485
|
+
| [values] | <code>Array.<IsElement></code> | <code>[]</code> | Provide an array of data that will be converted to array of elements. |
|
|
2486
|
+
| [classType] | <code>IsElement</code> | <code>ArrayElement</code> | Provide the type of IsElement to use. |
|
|
2492
2487
|
|
|
2493
|
-
**Kind**: global constant
|
|
2494
2488
|
<a name="services"></a>
|
|
2495
2489
|
|
|
2496
2490
|
## services
|
|
2497
2491
|
List helpful functions when dealing with collections.
|
|
2498
2492
|
|
|
2499
2493
|
**Kind**: global constant
|
|
2500
|
-
<a name="
|
|
2501
|
-
|
|
2502
|
-
## parseTree(tree, callback) ⇒ <code>IsArrayable.<IsTreeNode></code>
|
|
2503
|
-
Loop over all the nodes in a tree starting from left and apply a callback for each
|
|
2504
|
-
|
|
2505
|
-
**Kind**: global function
|
|
2494
|
+
<a name="recipes"></a>
|
|
2506
2495
|
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
| tree | <code>IsArrayable.<IsTreeNode></code> |
|
|
2510
|
-
| callback | <code>forEachCallback</code> |
|
|
2496
|
+
## recipes
|
|
2497
|
+
List of class declarations that can be used to specify attributes for a style of object / class.
|
|
2511
2498
|
|
|
2499
|
+
**Kind**: global constant
|
|
2512
2500
|
<a name="parseTreeNext"></a>
|
|
2513
2501
|
|
|
2514
2502
|
## parseTreeNext(treeNode) ⇒ <code>IsTreeNode</code> \| <code>null</code>
|
|
@@ -2527,3 +2515,15 @@ Be able to parse over every node in a tree.
|
|
|
2527
2515
|
| --- | --- | --- |
|
|
2528
2516
|
| treeNode | <code>IsTreeNode</code> | Provide a node in a tree and get the next node (left-first approach) |
|
|
2529
2517
|
|
|
2518
|
+
<a name="parseTree"></a>
|
|
2519
|
+
|
|
2520
|
+
## parseTree(tree, callback) ⇒ <code>IsArrayable.<IsTreeNode></code>
|
|
2521
|
+
Loop over all the nodes in a tree starting from left and apply a callback for each
|
|
2522
|
+
|
|
2523
|
+
**Kind**: global function
|
|
2524
|
+
|
|
2525
|
+
| Param | Type |
|
|
2526
|
+
| --- | --- |
|
|
2527
|
+
| tree | <code>IsArrayable.<IsTreeNode></code> |
|
|
2528
|
+
| callback | <code>forEachCallback</code> |
|
|
2529
|
+
|