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