collect-your-stuff 1.2.2 → 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 CHANGED
@@ -13,114 +13,117 @@ Data allocation and manipulation.
13
13
  ## Classes
14
14
 
15
15
  <dl>
16
- <dt><a href="#TreeLinkerIterator">TreeLinkerIterator</a></dt>
17
- <dd><p>Class TreeLinkerIterator returns the next value taking a left-first approach down a tree.</p>
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="#Runnable">Runnable</a></dt>
20
- <dd><p>Identify a class that can be run.</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="#LinkerIterator">LinkerIterator</a></dt>
23
- <dd><p>Class LinkerIterator returns the next value when using linkers of linked type lists.</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="#DoubleLinkerIterator">DoubleLinkerIterator</a></dt>
26
- <dd><p>Class DoubleLinkerIterator returns the next value when using linkers of linked type lists.</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="#ArrayIterator">ArrayIterator</a></dt>
29
- <dd><p>Class ArrayIterator returns the next value when using elements of array type list.</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="#Stackable">Stackable</a> ⇐ <code><a href="#Linker">Linker</a></code></dt>
32
- <dd><p>Stackable represents a runnable entry in stack.</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="#Stack">Stack</a></dt>
35
- <dd><p>Store a collection of items which can only be inserted and removed from the top.</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="#Queueable">Queueable</a> ⇐ <code><a href="#Linker">Linker</a></code></dt>
38
- <dd><p>Queueable represents a runnable entry in a queue.</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="#TreeLinker">TreeLinker</a> ⇐ <code><a href="#DoubleLinker">DoubleLinker</a></code></dt>
44
- <dd><p>TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.</p>
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="#LinkedTreeList">LinkedTreeList</a> ⇐ <code><a href="#DoublyLinkedList">DoublyLinkedList</a></code></dt>
47
- <dd><p>LinkedTreeList represents a collection stored with a root and spreading in branching (tree) formation.</p>
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="#Linker">Linker</a> ⇐ <code><a href="#ArrayElement">ArrayElement</a></code></dt>
50
- <dd><p>Linker represents a node in a LinkedList.</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="#LinkedList">LinkedList</a> ⇐ <code><a href="#Arrayable">Arrayable</a></code></dt>
53
- <dd><p>LinkedList represents a collection stored as a LinkedList with next references.</p>
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="#DoublyLinkedList">DoublyLinkedList</a> ⇐ <code><a href="#LinkedList">LinkedList</a></code></dt>
56
- <dd><p>DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.</p>
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="#DoubleLinker">DoubleLinker</a> ⇐ <code><a href="#Linker">Linker</a></code></dt>
59
- <dd><p>DoubleLinker represents a node in a DoublyLinkedList which is chained by next and prev.</p>
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="#Arrayable">Arrayable</a></dt>
62
- <dd><p>Arrayable represents a collection stored as an array.</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="#ArrayElement">ArrayElement</a></dt>
65
- <dd><p>Element represents a node in an Arrayable.</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="#Stackable">Stackable</a> ⇒ <code><a href="#Stackable">Stackable</a></code></dt>
73
- <dd><p>Make a new Stackable from the data given if it is not already a valid Stackable.</p>
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="#Queue">Queue</a> ⇒ <code><a href="#Queue">Queue</a></code></dt>
82
- <dd><p>Convert an array to a Queue.</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="#TreeLinker">TreeLinker</a> ⇒ <code><a href="#TreeLinker">TreeLinker</a></code></dt>
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="#LinkedTreeList">LinkedTreeList</a> ⇒ <code><a href="#LinkedTreeList">LinkedTreeList</a></code></dt>
88
- <dd><p>Convert an array into a LinkedTreeList instance, return the new instance.</p>
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="#DoublyLinkedList">DoublyLinkedList</a> ⇒ <code><a href="#DoublyLinkedList">DoublyLinkedList</a></code></dt>
97
- <dd><p>Convert an array into a DoublyLinkedList instance, return the new instance.</p>
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="#DoubleLinker">DoubleLinker</a> ⇒ <code><a href="#DoubleLinker">DoubleLinker</a></code></dt>
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="#Arrayable">Arrayable</a> ⇒ <code><a href="#Arrayable">Arrayable</a></code></dt>
103
- <dd><p>Convert an array to an Arrayable.</p>
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="#ArrayElement">ArrayElement</a> ⇒ <code><a href="#ArrayElement">ArrayElement</a></code></dt>
106
- <dd><p>Make a new Element from the data given if it is not already a valid Element.</p>
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.&lt;IsTreeNode&gt;</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.&lt;IsTreeNode&gt;</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="TreeLinkerIterator"></a>
154
+ <a name="Arrayable"></a>
155
155
 
156
- ## TreeLinkerIterator
157
- Class TreeLinkerIterator returns the next value taking a left-first approach down a tree.
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
- ## Runnable
163
- Identify a class that can be run.
161
+ * [Arrayable](#Arrayable)
162
+ * [new Arrayable()](#new_Arrayable_new)
163
+ * [.list](#Arrayable+list) ⇒ [<code>Array.&lt;ArrayElement&gt;</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
- **Kind**: global class
176
+ <a name="new_Arrayable_new"></a>
166
177
 
167
- * [Runnable](#Runnable)
168
- * [new Runnable(data)](#new_Runnable_new)
169
- * _instance_
170
- * [.task](#Runnable+task) ⇒ <code>function</code>
171
- * [.run()](#Runnable+run) ⇒ <code>\*</code>
172
- * _static_
173
- * [.isRunnable(thing)](#Runnable.isRunnable) ⇒ <code>boolean</code>
178
+ ### new Arrayable()
179
+ Create the new Arrayable instance, configure the Arrayable class.
174
180
 
175
- <a name="new_Runnable_new"></a>
181
+ <a name="Arrayable+list"></a>
176
182
 
177
- ### new Runnable(data)
178
- Instantiate a Runnable class.
183
+ ### arrayable.list ⇒ [<code>Array.&lt;ArrayElement&gt;</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
- | Param | Type |
182
- | --- | --- |
183
- | data | <code>\*</code> |
189
+ ### arrayable.first [<code>ArrayElement</code>](#ArrayElement)
190
+ Retrieve the first Element from the Arrayable
184
191
 
185
- <a name="Runnable+task"></a>
192
+ **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
193
+ <a name="Arrayable+last"></a>
186
194
 
187
- ### runnable.task ⇒ <code>function</code>
188
- Retrieve the data which should be formed as a task.
195
+ ### arrayable.last[<code>ArrayElement</code>](#ArrayElement)
196
+ Retrieve the last Element from the Arrayable
189
197
 
190
- **Kind**: instance property of [<code>Runnable</code>](#Runnable)
191
- <a name="Runnable+run"></a>
198
+ **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
199
+ <a name="Arrayable+length"></a>
192
200
 
193
- ### runnable.run() ⇒ <code>\*</code>
194
- Run the runnable task.
201
+ ### arrayable.length ⇒ <code>number</code>
202
+ Return the length of the list.
195
203
 
196
- **Kind**: instance method of [<code>Runnable</code>](#Runnable)
197
- <a name="Runnable.isRunnable"></a>
204
+ **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
205
+ <a name="Arrayable+initialize"></a>
198
206
 
199
- ### Runnable.isRunnable(thing) ⇒ <code>boolean</code>
200
- Check if a given thing is Runnable
207
+ ### arrayable.initialize(initialList) ⇒ [<code>Arrayable</code>](#Arrayable)
208
+ Initialize the inner list, should only run once.
201
209
 
202
- **Kind**: static method of [<code>Runnable</code>](#Runnable)
210
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
203
211
 
204
- | Param | Type |
205
- | --- | --- |
206
- | thing | <code>\*</code> |
212
+ | Param | Type | Description |
213
+ | --- | --- | --- |
214
+ | initialList | [<code>Array.&lt;ArrayElement&gt;</code>](#ArrayElement) | Give the array of elements to start in this Arrayable. |
207
215
 
208
- <a name="LinkerIterator"></a>
216
+ <a name="Arrayable+insertAfter"></a>
209
217
 
210
- ## LinkerIterator
211
- Class LinkerIterator returns the next value when using linkers of linked type lists.
218
+ ### arrayable.insertAfter(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
219
+ Insert a new node (or data) after a node.
212
220
 
213
- **Kind**: global class
214
- <a name="DoubleLinkerIterator"></a>
221
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
215
222
 
216
- ## DoubleLinkerIterator
217
- Class DoubleLinkerIterator returns the next value when using linkers of linked type lists.
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
- **Kind**: global class
220
- <a name="ArrayIterator"></a>
228
+ <a name="Arrayable+insertBefore"></a>
221
229
 
222
- ## ArrayIterator
223
- Class ArrayIterator returns the next value when using elements of array type list.
230
+ ### arrayable.insertBefore(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
231
+ Insert a new node (or data) before a node.
224
232
 
225
- **Kind**: global class
226
- <a name="Stackable"></a>
233
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
227
234
 
228
- ## Stackable [<code>Linker</code>](#Linker)
229
- Stackable represents a runnable entry in stack.
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
- **Kind**: global class
232
- **Extends**: [<code>Linker</code>](#Linker)
240
+ <a name="Arrayable+append"></a>
233
241
 
234
- * [Stackable](#Stackable) [<code>Linker</code>](#Linker)
235
- * [new Stackable([stackData])](#new_Stackable_new)
236
- * _instance_
237
- * [.task](#Stackable+task) ⇒ <code>\*</code>
238
- * [.run()](#Stackable+run) ⇒ <code>\*</code>
239
- * _static_
240
- * [.fromArray([values], [classType])](#Stackable.fromArray) ⇒ <code>Object</code>
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
- <a name="new_Stackable_new"></a>
245
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
243
246
 
244
- ### new Stackable([stackData])
245
- Create a stackable item that can be used in a stack.
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
- | Param | Type | Default | Description |
249
- | --- | --- | --- | --- |
250
- | [stackData] | <code>Object</code> | <code>{}</code> | |
251
- | [stackData.task] | <code>\*</code> | <code></code> | The data to be stored in this stackable |
252
- | [stackData.next] | [<code>Stackable</code>](#Stackable) \| <code>null</code> | <code></code> | The reference to the next stackable if any |
253
- | [stackData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Indicate if the stackable is ready to run |
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
- <a name="Stack+empty"></a>
257
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
308
258
 
309
- ### stack.empty() <code>boolean</code>
310
- Return true if the stack is empty (there are no tasks in the stacked list)
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
- **Kind**: instance method of [<code>Stack</code>](#Stack)
313
- <a name="Stack+top"></a>
264
+ <a name="Arrayable+remove"></a>
314
265
 
315
- ### stack.top() ⇒ [<code>Stackable</code>](#Stackable)
316
- Take a look at the next stacked task
266
+ ### arrayable.remove(node) ⇒ [<code>ArrayElement</code>](#ArrayElement)
267
+ Remove an element from this arrayable.
317
268
 
318
- **Kind**: instance method of [<code>Stack</code>](#Stack)
319
- <a name="Stack+pop"></a>
269
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
320
270
 
321
- ### stack.pop() [<code>Stackable</code>](#Stackable) \| <code>null</code>
322
- Remove the next stacked task and return it.
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
- **Kind**: instance method of [<code>Stack</code>](#Stack)
325
- <a name="Stack+push"></a>
275
+ <a name="Arrayable+item"></a>
326
276
 
327
- ### stack.push(stackable)
328
- Push a stackable task to the top of the stack.
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>Stack</code>](#Stack)
280
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
331
281
 
332
282
  | Param | Type | Description |
333
283
  | --- | --- | --- |
334
- | stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> | Add a new stackable to the top of the stack |
284
+ | index | <code>number</code> | The integer number for retrieving a node by position. |
335
285
 
336
- <a name="Stack+remove"></a>
286
+ <a name="Arrayable+forEach"></a>
337
287
 
338
- ### stack.remove() ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
339
- Remove the next stacked task and return it.
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>Stack</code>](#Stack)
342
- <a name="Stack+size"></a>
291
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
343
292
 
344
- ### stack.size() <code>number</code>
345
- Get the size of the current stack.
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
- **Kind**: instance method of [<code>Stack</code>](#Stack)
348
- <a name="Queueable"></a>
298
+ <a name="ArrayElement"></a>
349
299
 
350
- ## Queueable ⇐ [<code>Linker</code>](#Linker)
351
- Queueable represents a runnable entry in a queue.
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
- <a name="new_Queueable_new"></a>
367
-
368
- ### new Queueable([queueableData])
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
- **Kind**: instance property of [<code>Queueable</code>](#Queueable)
391
- <a name="Queueable+markCompleted"></a>
309
+ <a name="new_ArrayElement_new"></a>
392
310
 
393
- ### queueable.markCompleted(completeResponse) ⇒ <code>completeResponse</code>
394
- Set this queueable as completed.
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
- | completeResponse | <code>Object</code> | | |
401
- | [completeResponse.success] | <code>\*</code> | <code>true</code> | Indicate when the task failed (use false) or give a success message |
402
- | [completeResponse.error] | <code>\*</code> | <code>false</code> | Indicate a task was error-free (use false) or give an error message |
403
- | [completeResponse.context] | <code>\*</code> | <code></code> | Provide additional data in the response |
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
- **Kind**: instance method of [<code>Queueable</code>](#Queueable)
411
- <a name="Queueable.fromArray"></a>
319
+ <a name="ArrayElement.fromArray"></a>
412
320
 
413
- ### Queueable.fromArray(values, [classType]) ⇒ <code>Object</code>
414
- Convert an array into Queueable instances, return the head and tail Queueables.
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>Queueable</code>](#Queueable)
324
+ **Kind**: static method of [<code>ArrayElement</code>](#ArrayElement)
417
325
 
418
326
  | Param | Type | Default | Description |
419
327
  | --- | --- | --- | --- |
420
- | values | <code>Array</code> | | Provide an array of data that will be converted to a chain of queueable linkers. |
421
- | [classType] | <code>IsLinker</code> | <code>Queueable</code> | Provide the type of IsLinker to use. |
422
-
423
- <a name="Queue"></a>
424
-
425
- ## Queue
426
- Maintain a series of queued items.
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.&lt;IsElement&gt;</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
- **Kind**: instance method of [<code>Queue</code>](#Queue)
492
- <a name="TreeLinker"></a>
331
+ <a name="DoubleLinker"></a>
493
332
 
494
- ## TreeLinker ⇐ [<code>DoubleLinker</code>](#DoubleLinker)
495
- TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.
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>DoubleLinker</code>](#DoubleLinker)
337
+ **Extends**: [<code>Linker</code>](#Linker)
499
338
 
500
- * [TreeLinker](#TreeLinker) ⇐ [<code>DoubleLinker</code>](#DoubleLinker)
501
- * [new TreeLinker([settings], listClass)](#new_TreeLinker_new)
502
- * _instance_
503
- * [.childrenFromArray(children, listClass)](#TreeLinker+childrenFromArray) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
504
- * _static_
505
- * [.fromArray([values], [classType])](#TreeLinker.fromArray) ⇒ <code>Object</code>
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="new_TreeLinker_new"></a>
343
+ <a name="new_DoubleLinker_new"></a>
508
344
 
509
- ### new TreeLinker([settings], listClass)
510
- Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.
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
- | [settings] | <code>Object</code> | <code>{}</code> | |
516
- | [settings.data] | <code>\*</code> | <code></code> | The data to be stored in this tree node |
517
- | [settings.next] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to the next linker if any |
518
- | [settings.prev] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to the previous linker if any |
519
- | [settings.children] | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code></code> | The references to child linkers if any |
520
- | [settings.parent] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to a parent linker if any |
521
- | listClass | <code>IsArrayable.&lt;IsTreeNode&gt;</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.&lt;IsTreeNode&gt;</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="TreeLinker.fromArray"></a>
356
+ <a name="DoubleLinker.fromArray"></a>
536
357
 
537
- ### TreeLinker.fromArray([values], [classType]) ⇒ <code>Object</code>
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>TreeLinker</code>](#TreeLinker)
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 tree-linkers. |
545
- | [classType] | <code>IsTreeNode</code> | <code>TreeLinker</code> | Provide the type of IsTreeNode to use. |
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="LinkedTreeList"></a>
368
+ <a name="DoublyLinkedList"></a>
548
369
 
549
- ## LinkedTreeList ⇐ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
550
- LinkedTreeList represents a collection stored with a root and spreading in branching (tree) formation.
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>DoublyLinkedList</code>](#DoublyLinkedList)
374
+ **Extends**: [<code>LinkedList</code>](#LinkedList)
554
375
 
555
- * [LinkedTreeList](#LinkedTreeList) ⇐ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
556
- * [new LinkedTreeList()](#new_LinkedTreeList_new)
557
- * [.list](#LinkedTreeList+list) ⇒ [<code>TreeLinker</code>](#TreeLinker)
558
- * [.first](#LinkedTreeList+first) ⇒ [<code>TreeLinker</code>](#TreeLinker)
559
- * [.last](#LinkedTreeList+last) ⇒ [<code>TreeLinker</code>](#TreeLinker)
560
- * [.length](#LinkedTreeList+length) ⇒ <code>number</code>
561
- * [.parent](#LinkedTreeList+parent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
562
- * [.parent](#LinkedTreeList+parent)
563
- * [.rootParent](#LinkedTreeList+rootParent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
564
- * [.initialize(initialList)](#LinkedTreeList+initialize) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
565
- * [.setChildren(item, children)](#LinkedTreeList+setChildren)
566
- * [.insertAfter(node, newNode)](#LinkedTreeList+insertAfter) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
567
- * [.insertBefore(node, newNode)](#LinkedTreeList+insertBefore) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
568
- * [.append(node, after)](#LinkedTreeList+append) ⇒ [<code>TreeLinker</code>](#TreeLinker)
569
- * [.prepend(node, before)](#LinkedTreeList+prepend) ⇒ [<code>TreeLinker</code>](#TreeLinker)
570
- * [.remove(node)](#LinkedTreeList+remove) ⇒ [<code>TreeLinker</code>](#TreeLinker)
571
- * [.reset()](#LinkedTreeList+reset) ⇒ [<code>TreeLinker</code>](#TreeLinker)
572
- * [.item(index)](#LinkedTreeList+item) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
573
- * [.forEach(callback, thisArg)](#LinkedTreeList+forEach)
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="new_LinkedTreeList_new"></a>
392
+ <a name="new_DoublyLinkedList_new"></a>
576
393
 
577
- ### new LinkedTreeList()
578
- Create the new LinkedTreeList instance, configure the list class.
394
+ ### new DoublyLinkedList()
395
+ Create the new DoublyLinkedList instance.
579
396
 
580
- <a name="LinkedTreeList+list"></a>
397
+ <a name="DoublyLinkedList+list"></a>
581
398
 
582
- ### linkedTreeList.list ⇒ [<code>TreeLinker</code>](#TreeLinker)
399
+ ### doublyLinkedList.list ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
583
400
  Retrieve a copy of the innerList used.
584
401
 
585
- **Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
586
- **Overrides**: [<code>list</code>](#DoublyLinkedList+list)
587
- <a name="LinkedTreeList+first"></a>
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
- ### linkedTreeList.first ⇒ [<code>TreeLinker</code>](#TreeLinker)
590
- Retrieve the first TreeLinker in the list.
406
+ ### doublyLinkedList.first ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
407
+ Retrieve the first DoubleLinker in the list.
591
408
 
592
- **Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
593
- **Overrides**: [<code>first</code>](#DoublyLinkedList+first)
594
- <a name="LinkedTreeList+last"></a>
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
- ### linkedTreeList.last ⇒ [<code>TreeLinker</code>](#TreeLinker)
597
- Retrieve the last TreeLinker in the list.
413
+ ### doublyLinkedList.last ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
414
+ Retrieve the last DoubleLinker in the list.
598
415
 
599
- **Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
600
- **Overrides**: [<code>last</code>](#DoublyLinkedList+last)
601
- <a name="LinkedTreeList+length"></a>
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
- ### linkedTreeList.length ⇒ <code>number</code>
420
+ ### doublyLinkedList.length ⇒ <code>number</code>
604
421
  Return the length of the list.
605
422
 
606
- **Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
607
- **Overrides**: [<code>length</code>](#DoublyLinkedList+length)
608
- <a name="LinkedTreeList+parent"></a>
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
- ### linkedTreeList.initialize(initialList) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
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>LinkedTreeList</code>](#LinkedTreeList)
637
- **Overrides**: [<code>initialize</code>](#DoublyLinkedList+initialize)
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
- | item | [<code>TreeLinker</code>](#TreeLinker) | The TreeLinker node that will be the parent of the children |
653
- | children | [<code>LinkedTreeList</code>](#LinkedTreeList) | The LinkedTreeList which has the child nodes to use |
435
+ | initialList | [<code>DoubleLinker</code>](#DoubleLinker) | Give the list of double-linkers to start in this doubly linked-list. |
654
436
 
655
- <a name="LinkedTreeList+insertAfter"></a>
437
+ <a name="DoublyLinkedList+insertAfter"></a>
656
438
 
657
- ### linkedTreeList.insertAfter(node, newNode) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
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>LinkedTreeList</code>](#LinkedTreeList)
661
- **Overrides**: [<code>insertAfter</code>](#DoublyLinkedList+insertAfter)
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>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The existing node as reference |
666
- | newNode | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to go after the existing node |
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="LinkedTreeList+insertBefore"></a>
450
+ <a name="DoublyLinkedList+insertBefore"></a>
669
451
 
670
- ### linkedTreeList.insertBefore(node, newNode) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
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>LinkedTreeList</code>](#LinkedTreeList)
674
- **Overrides**: [<code>insertBefore</code>](#DoublyLinkedList+insertBefore)
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>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The existing node as reference |
679
- | newNode | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to go before the existing node |
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="LinkedTreeList+append"></a>
463
+ <a name="DoublyLinkedList+append"></a>
682
464
 
683
- ### linkedTreeList.append(node, after) ⇒ [<code>TreeLinker</code>](#TreeLinker)
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>LinkedTreeList</code>](#LinkedTreeList)
687
- **Overrides**: [<code>append</code>](#DoublyLinkedList+append)
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>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to add to the end of the list |
692
- | after | [<code>TreeLinker</code>](#TreeLinker) | The existing last node |
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="LinkedTreeList+prepend"></a>
476
+ <a name="DoublyLinkedList+prepend"></a>
695
477
 
696
- ### linkedTreeList.prepend(node, before) ⇒ [<code>TreeLinker</code>](#TreeLinker)
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>LinkedTreeList</code>](#LinkedTreeList)
700
- **Overrides**: [<code>prepend</code>](#DoublyLinkedList+prepend)
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>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to add to the start of the list |
705
- | before | [<code>TreeLinker</code>](#TreeLinker) | The existing first node |
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="LinkedTreeList+remove"></a>
489
+ <a name="DoublyLinkedList+remove"></a>
708
490
 
709
- ### linkedTreeList.remove(node) ⇒ [<code>TreeLinker</code>](#TreeLinker)
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>LinkedTreeList</code>](#LinkedTreeList)
713
- **Overrides**: [<code>remove</code>](#DoublyLinkedList+remove)
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>TreeLinker</code>](#TreeLinker) | The node we wish to remove (and it will be returned after removal) |
499
+ | node | [<code>DoubleLinker</code>](#DoubleLinker) | The node we wish to remove (and it will be returned after removal) |
718
500
 
719
- <a name="LinkedTreeList+reset"></a>
501
+ <a name="DoublyLinkedList+reset"></a>
720
502
 
721
- ### linkedTreeList.reset() ⇒ [<code>TreeLinker</code>](#TreeLinker)
503
+ ### doublyLinkedList.reset() ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
722
504
  Refresh all references and return head reference.
723
505
 
724
- **Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
725
- **Overrides**: [<code>reset</code>](#DoublyLinkedList+reset)
726
- <a name="LinkedTreeList+item"></a>
506
+ **Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
507
+ <a name="DoublyLinkedList+item"></a>
727
508
 
728
- ### linkedTreeList.item(index) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
729
- Retrieve a TreeLinker item from this list by numeric index, otherwise return null.
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>LinkedTreeList</code>](#LinkedTreeList)
732
- **Overrides**: [<code>item</code>](#DoublyLinkedList+item)
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="LinkedTreeList+forEach"></a>
519
+ <a name="DoublyLinkedList+forEach"></a>
739
520
 
740
- ### linkedTreeList.forEach(callback, thisArg)
741
- Be able to run forEach on this LinkedTreeList to iterate over the TreeLinker Items.
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>LinkedTreeList</code>](#LinkedTreeList)
744
- **Overrides**: [<code>forEach</code>](#DoublyLinkedList+forEach)
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 tree node |
749
- | thisArg | [<code>LinkedTreeList</code>](#LinkedTreeList) | Optional, 'this' reference |
750
-
751
- <a name="Linker"></a>
752
-
753
- ## Linker ⇐ [<code>ArrayElement</code>](#ArrayElement)
754
- Linker represents a node in a LinkedList.
755
-
756
- **Kind**: global class
757
- **Extends**: [<code>ArrayElement</code>](#ArrayElement)
758
-
759
- * [Linker](#Linker) ⇐ [<code>ArrayElement</code>](#ArrayElement)
760
- * [new Linker([nodeData])](#new_Linker_new)
761
- * [.fromArray([values], [classType])](#Linker.fromArray) ⇒ <code>Object</code>
762
-
763
- <a name="new_Linker_new"></a>
764
-
765
- ### new Linker([nodeData])
766
- Create the new Linker instance, provide the data and optionally give the next Linker.
767
-
768
-
769
- | Param | Type | Default | Description |
770
- | --- | --- | --- | --- |
771
- | [nodeData] | <code>Object</code> | <code>{}</code> | |
772
- | [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
773
- | [nodeData.next] | [<code>Linker</code>](#Linker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
774
-
775
- <a name="Linker.fromArray"></a>
776
-
777
- ### Linker.fromArray([values], [classType]) ⇒ <code>Object</code>
778
- Convert an array into Linker instances, return the head and tail Linkers.
779
-
780
- **Kind**: static method of [<code>Linker</code>](#Linker)
781
-
782
- | Param | Type | Default | Description |
783
- | --- | --- | --- | --- |
784
- | [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
785
- | [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
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="DoublyLinkedList"></a>
689
+ <a name="Linker"></a>
945
690
 
946
- ## DoublyLinkedList ⇐ [<code>LinkedList</code>](#LinkedList)
947
- DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.
691
+ ## Linker ⇐ [<code>ArrayElement</code>](#ArrayElement)
692
+ Linker represents a node in a LinkedList.
948
693
 
949
694
  **Kind**: global class
950
- **Extends**: [<code>LinkedList</code>](#LinkedList)
695
+ **Extends**: [<code>ArrayElement</code>](#ArrayElement)
951
696
 
952
- * [DoublyLinkedList](#DoublyLinkedList) ⇐ [<code>LinkedList</code>](#LinkedList)
953
- * [new DoublyLinkedList()](#new_DoublyLinkedList_new)
954
- * [.list](#DoublyLinkedList+list) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
955
- * [.first](#DoublyLinkedList+first) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
956
- * [.last](#DoublyLinkedList+last) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
957
- * [.length](#DoublyLinkedList+length) ⇒ <code>number</code>
958
- * [.initialize(initialList)](#DoublyLinkedList+initialize) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
959
- * [.insertAfter(node, newNode)](#DoublyLinkedList+insertAfter) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
960
- * [.insertBefore(node, newNode)](#DoublyLinkedList+insertBefore) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
961
- * [.append(node, after)](#DoublyLinkedList+append) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
962
- * [.prepend(node, before)](#DoublyLinkedList+prepend) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
963
- * [.remove(node)](#DoublyLinkedList+remove) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
964
- * [.reset()](#DoublyLinkedList+reset) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
965
- * [.item(index)](#DoublyLinkedList+item) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
966
- * [.forEach(callback, thisArg)](#DoublyLinkedList+forEach)
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="new_DoublyLinkedList_new"></a>
701
+ <a name="new_Linker_new"></a>
969
702
 
970
- ### new DoublyLinkedList()
971
- Create the new DoublyLinkedList instance.
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
- ### doublyLinkedList.list [<code>DoubleLinker</code>](#DoubleLinker)
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>DoublyLinkedList</code>](#DoublyLinkedList)
979
- **Overrides**: [<code>list</code>](#LinkedList+list)
980
- <a name="DoublyLinkedList+first"></a>
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
- ### doublyLinkedList.first ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
983
- Retrieve the first DoubleLinker in the list.
767
+ ### linkedTreeList.first ⇒ [<code>TreeLinker</code>](#TreeLinker)
768
+ Retrieve the first TreeLinker in the list.
984
769
 
985
- **Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
986
- **Overrides**: [<code>first</code>](#LinkedList+first)
987
- <a name="DoublyLinkedList+last"></a>
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
- ### doublyLinkedList.last ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
990
- Retrieve the last DoubleLinker in the list.
774
+ ### linkedTreeList.last ⇒ [<code>TreeLinker</code>](#TreeLinker)
775
+ Retrieve the last TreeLinker in the list.
991
776
 
992
- **Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
993
- **Overrides**: [<code>last</code>](#LinkedList+last)
994
- <a name="DoublyLinkedList+length"></a>
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
- ### doublyLinkedList.length ⇒ <code>number</code>
781
+ ### linkedTreeList.length ⇒ <code>number</code>
997
782
  Return the length of the list.
998
783
 
999
- **Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
1000
- **Overrides**: [<code>length</code>](#LinkedList+length)
1001
- <a name="DoublyLinkedList+initialize"></a>
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
- ### doublyLinkedList.initialize(initialList) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
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>DoublyLinkedList</code>](#DoublyLinkedList)
1007
- **Overrides**: [<code>initialize</code>](#LinkedList+initialize)
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
- | initialList | [<code>DoubleLinker</code>](#DoubleLinker) | Give the list of double-linkers to start in this doubly linked-list. |
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="DoublyLinkedList+insertAfter"></a>
833
+ <a name="LinkedTreeList+insertAfter"></a>
1014
834
 
1015
- ### doublyLinkedList.insertAfter(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
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>DoublyLinkedList</code>](#DoublyLinkedList)
1019
- **Overrides**: [<code>insertAfter</code>](#LinkedList+insertAfter)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The existing node as reference |
1024
- | newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to go after the existing node |
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="DoublyLinkedList+insertBefore"></a>
846
+ <a name="LinkedTreeList+insertBefore"></a>
1027
847
 
1028
- ### doublyLinkedList.insertBefore(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
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>DoublyLinkedList</code>](#DoublyLinkedList)
1032
- **Overrides**: [<code>insertBefore</code>](#LinkedList+insertBefore)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The existing node as reference |
1037
- | newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to go before the existing node |
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="DoublyLinkedList+append"></a>
859
+ <a name="LinkedTreeList+append"></a>
1040
860
 
1041
- ### doublyLinkedList.append(node, after) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
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>DoublyLinkedList</code>](#DoublyLinkedList)
1045
- **Overrides**: [<code>append</code>](#LinkedList+append)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to add to the end of the list |
1050
- | after | [<code>DoubleLinker</code>](#DoubleLinker) | The existing last node |
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="DoublyLinkedList+prepend"></a>
872
+ <a name="LinkedTreeList+prepend"></a>
1053
873
 
1054
- ### doublyLinkedList.prepend(node, before) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
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>DoublyLinkedList</code>](#DoublyLinkedList)
1058
- **Overrides**: [<code>prepend</code>](#LinkedList+prepend)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to add to the start of the list |
1063
- | before | [<code>DoubleLinker</code>](#DoubleLinker) | The existing first node |
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="DoublyLinkedList+remove"></a>
885
+ <a name="LinkedTreeList+remove"></a>
1066
886
 
1067
- ### doublyLinkedList.remove(node) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
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>DoublyLinkedList</code>](#DoublyLinkedList)
1071
- **Overrides**: [<code>remove</code>](#LinkedList+remove)
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>DoubleLinker</code>](#DoubleLinker) | The node we wish to remove (and it will be returned after removal) |
895
+ | node | [<code>TreeLinker</code>](#TreeLinker) | The node we wish to remove (and it will be returned after removal) |
1076
896
 
1077
- <a name="DoublyLinkedList+reset"></a>
897
+ <a name="LinkedTreeList+reset"></a>
1078
898
 
1079
- ### doublyLinkedList.reset() ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
899
+ ### linkedTreeList.reset() ⇒ [<code>TreeLinker</code>](#TreeLinker)
1080
900
  Refresh all references and return head reference.
1081
901
 
1082
- **Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
1083
- <a name="DoublyLinkedList+item"></a>
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
- ### doublyLinkedList.item(index) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
1086
- Retrieve a DoubleLinker item from this list by numeric index, otherwise return null.
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>DoublyLinkedList</code>](#DoublyLinkedList)
1089
- **Overrides**: [<code>item</code>](#LinkedList+item)
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="DoublyLinkedList+forEach"></a>
916
+ <a name="LinkedTreeList+forEach"></a>
1096
917
 
1097
- ### doublyLinkedList.forEach(callback, thisArg)
1098
- Be able to run forEach on this DoublyLinkedList to iterate over the DoubleLinker Items.
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>DoublyLinkedList</code>](#DoublyLinkedList)
1101
- **Overrides**: [<code>forEach</code>](#LinkedList+forEach)
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 double linker |
1106
- | thisArg | [<code>DoublyLinkedList</code>](#DoublyLinkedList) | Optional, 'this' reference |
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="DoubleLinker"></a>
929
+ <a name="TreeLinker"></a>
1109
930
 
1110
- ## DoubleLinker ⇐ [<code>Linker</code>](#Linker)
1111
- DoubleLinker represents a node in a DoublyLinkedList which is chained by next and prev.
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>Linker</code>](#Linker)
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
- | Param | Type | Default | Description |
1127
- | --- | --- | --- | --- |
1128
- | [nodeData] | <code>Object</code> | <code>{}</code> | |
1129
- | [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
1130
- | [nodeData.next] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
1131
- | [nodeData.prev] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> | The reference to the previous linker if any |
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="DoubleLinker.fromArray"></a>
944
+ <a name="new_TreeLinker_new"></a>
1134
945
 
1135
- ### DoubleLinker.fromArray([values], [classType]) ⇒ <code>Object</code>
1136
- Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
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
- | [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
1143
- | [classType] | <code>IsDoubleLinker</code> | <code>DoubleLinker</code> | Provide the type of IsDoubleLinker to use. |
1144
-
1145
- <a name="Arrayable"></a>
1146
-
1147
- ## Arrayable
1148
- Arrayable represents a collection stored as an array.
1149
-
1150
- **Kind**: global class
1151
-
1152
- * [Arrayable](#Arrayable)
1153
- * [new Arrayable()](#new_Arrayable_new)
1154
- * [.list](#Arrayable+list) ⇒ [<code>Array.&lt;ArrayElement&gt;</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.&lt;ArrayElement&gt;</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.&lt;ArrayElement&gt;</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.&lt;IsTreeNode&gt;</code> | | Give the type of list to use for storing the children |
1218
959
 
1219
- <a name="Arrayable+insertBefore"></a>
960
+ <a name="TreeLinker+childrenFromArray"></a>
1220
961
 
1221
- ### arrayable.insertBefore(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
1222
- Insert a new node (or data) before a node.
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>Arrayable</code>](#Arrayable)
965
+ **Kind**: instance method of [<code>TreeLinker</code>](#TreeLinker)
1225
966
 
1226
967
  | Param | Type | Description |
1227
968
  | --- | --- | --- |
1228
- | node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
1229
- | newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go before the existing node |
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.&lt;IsTreeNode&gt;</code> | Give the type of list to use for storing the children |
1230
971
 
1231
- <a name="Arrayable+append"></a>
972
+ <a name="TreeLinker.fromArray"></a>
1232
973
 
1233
- ### arrayable.append(node, after) ⇒ [<code>Arrayable</code>](#Arrayable)
1234
- Add a node (or data) after the given (or last) node in the list.
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**: instance method of [<code>Arrayable</code>](#Arrayable)
977
+ **Kind**: static method of [<code>TreeLinker</code>](#TreeLinker)
1237
978
 
1238
- | Param | Type | Description |
1239
- | --- | --- | --- |
1240
- | node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the end of the list |
1241
- | after | [<code>ArrayElement</code>](#ArrayElement) | The existing last node |
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="Arrayable+prepend"></a>
984
+ <a name="Queue"></a>
1244
985
 
1245
- ### arrayable.prepend(node, before) ⇒ [<code>Arrayable</code>](#Arrayable)
1246
- Add a node (or data) before the given (or first) node in the list.
986
+ ## Queue
987
+ Maintain a series of queued items.
1247
988
 
1248
- **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
989
+ **Kind**: global class
1249
990
 
1250
- | Param | Type | Description |
1251
- | --- | --- | --- |
1252
- | node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the start of the list |
1253
- | before | [<code>ArrayElement</code>](#ArrayElement) | The existing first node |
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="Arrayable+remove"></a>
1000
+ <a name="new_Queue_new"></a>
1256
1001
 
1257
- ### arrayable.remove(node) [<code>ArrayElement</code>](#ArrayElement)
1258
- Remove an element from this arrayable.
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
- | node | [<code>ArrayElement</code>](#ArrayElement) | The node we wish to remove (and it will be returned after removal) |
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="Arrayable+item"></a>
1012
+ <a name="Queue+dequeue"></a>
1267
1013
 
1268
- ### arrayable.item(index) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
1269
- Retrieve an ArrayElement item from this list by numeric index, otherwise return null.
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>Arrayable</code>](#Arrayable)
1017
+ **Kind**: instance method of [<code>Queue</code>](#Queue)
1018
+ <a name="Queue+empty"></a>
1272
1019
 
1273
- | Param | Type | Description |
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
- <a name="Arrayable+forEach"></a>
1023
+ **Kind**: instance method of [<code>Queue</code>](#Queue)
1024
+ <a name="Queue+enqueue"></a>
1278
1025
 
1279
- ### arrayable.forEach(callback, thisArg) ⇒ [<code>Arrayable</code>](#Arrayable)
1280
- Be able to run forEach on this Arrayable to iterate over the elements.
1026
+ ### queue.enqueue(queueable)
1027
+ Add a queued task to the end of the queue
1281
1028
 
1282
- **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
1029
+ **Kind**: instance method of [<code>Queue</code>](#Queue)
1283
1030
 
1284
1031
  | Param | Type | Description |
1285
1032
  | --- | --- | --- |
1286
- | callback | <code>forEachCallback</code> | The function to call for-each element |
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
- **Kind**: global class
1035
+ <a name="Queue+peek"></a>
1295
1036
 
1296
- * [ArrayElement](#ArrayElement)
1297
- * [new ArrayElement([data])](#new_ArrayElement_new)
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
- <a name="new_ArrayElement_new"></a>
1040
+ **Kind**: instance method of [<code>Queue</code>](#Queue)
1041
+ <a name="Queue+remove"></a>
1301
1042
 
1302
- ### new ArrayElement([data])
1303
- Create the new Element instance, provide the data and optionally configure the type of Element.
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
- | Param | Type | Default | Description |
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
- <a name="ArrayElement.fromArray"></a>
1052
+ **Kind**: instance method of [<code>Queue</code>](#Queue)
1053
+ <a name="Queueable"></a>
1311
1054
 
1312
- ### ArrayElement.fromArray([values], [classType]) ⇒ <code>Object</code>
1313
- Convert an array into Element instances, return the head and tail Elements.
1055
+ ## Queueable [<code>Linker</code>](#Linker)
1056
+ Queueable represents a runnable entry in a queue.
1314
1057
 
1315
- **Kind**: static method of [<code>ArrayElement</code>](#ArrayElement)
1058
+ **Kind**: global class
1059
+ **Extends**: [<code>Linker</code>](#Linker)
1316
1060
 
1317
- | Param | Type | Default | Description |
1318
- | --- | --- | --- | --- |
1319
- | [values] | <code>Array.&lt;IsElement&gt;</code> | <code>[]</code> | Provide an array of data that will be converted to array of elements. |
1320
- | [classType] | <code>IsElement</code> | <code>ArrayElement</code> | Provide the type of IsElement to use. |
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="Stackable"></a>
1071
+ <a name="new_Queueable_new"></a>
1323
1072
 
1324
- ## Stackable [<code>Stackable</code>](#Stackable)
1325
- Make a new Stackable from the data given if it is not already a valid Stackable.
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
- | stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> | | Return a valid Stackable instance from given data, or even an already valid one. |
1332
- | [classType] | <code>IsLinker</code> | <code>Stackable</code> | Provide the type of IsLinker to use. |
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
- * [Stackable](#Stackable)[<code>Stackable</code>](#Stackable)
1336
- * [new Stackable([stackData])](#new_Stackable_new)
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
- <a name="new_Stackable_new"></a>
1089
+ **Kind**: instance property of [<code>Queueable</code>](#Queueable)
1090
+ <a name="Queueable+task"></a>
1344
1091
 
1345
- ### new Stackable([stackData])
1346
- Create a stackable item that can be used in a stack.
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
- | Param | Type | Default | Description |
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
- <a name="Stackable+task"></a>
1101
+ **Kind**: instance method of [<code>Queueable</code>](#Queueable)
1357
1102
 
1358
- ### stackable.task <code>\*</code>
1359
- Retrieve the data which should be formed as a task.
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
- **Kind**: instance property of [<code>Stackable</code>](#Stackable)
1362
- <a name="Stackable+run"></a>
1110
+ <a name="Queueable+run"></a>
1363
1111
 
1364
- ### stackable.run() ⇒ <code>\*</code>
1365
- Run the stacked task.
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>Stackable</code>](#Stackable)
1368
- <a name="Stackable.fromArray"></a>
1115
+ **Kind**: instance method of [<code>Queueable</code>](#Queueable)
1116
+ <a name="Queueable.fromArray"></a>
1369
1117
 
1370
- ### Stackable.fromArray([values], [classType]) ⇒ <code>Object</code>
1371
- Convert an array into Stackable instances, return the head and tail Stackables.
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>Stackable</code>](#Stackable)
1121
+ **Kind**: static method of [<code>Queueable</code>](#Queueable)
1374
1122
 
1375
1123
  | Param | Type | Default | Description |
1376
1124
  | --- | --- | --- | --- |
1377
- | [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of stackable linkers. |
1378
- | [classType] | <code>IsLinker</code> | <code>Stackable</code> | Provide the type of IsLinker to use. |
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 ⇒ [<code>Stack</code>](#Stack)
1383
- Convert an array to a Stack.
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) ⇒ [<code>Stack</code>](#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="Queueable"></a>
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
- ## Queueable ⇒ [<code>Queueable</code>](#Queueable)
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
- **Kind**: global variable
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
- * [Queueable](#Queueable) ⇒ [<code>Queueable</code>](#Queueable)
1470
- * [new Queueable([queueableData])](#new_Queueable_new)
1471
- * _instance_
1472
- * [.isReady](#Queueable+isReady) ⇒ <code>boolean</code>
1473
- * [.task](#Queueable+task) ⇒ <code>\*</code>
1474
- * [.markCompleted(completeResponse)](#Queueable+markCompleted) ⇒ <code>completeResponse</code>
1475
- * [.run()](#Queueable+run) ⇒ <code>completeResponse</code>
1476
- * _static_
1477
- * [.fromArray(values, [classType])](#Queueable.fromArray) ⇒ <code>Object</code>
1293
+ <a name="Runnable+task"></a>
1478
1294
 
1479
- <a name="new_Queueable_new"></a>
1295
+ ### runnable.task ⇒ <code>function</code>
1296
+ Retrieve the data which should be formed as a task.
1480
1297
 
1481
- ### new Queueable([queueableData])
1482
- Create a queueable item that can be used in a queue.
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
- | Param | Type | Default | Description |
1486
- | --- | --- | --- | --- |
1487
- | [queueableData] | <code>Object</code> | <code>{}</code> | |
1488
- | [queueableData.task] | <code>\*</code> | <code></code> | The data to be stored in this queueable |
1489
- | [queueableData.next] | [<code>Queueable</code>](#Queueable) \| <code>null</code> | <code></code> | The reference to the next queueable if any |
1490
- | [queueableData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> | Indicate if the queueable is ready to run |
1304
+ **Kind**: instance method of [<code>Runnable</code>](#Runnable)
1305
+ <a name="Runnable.isRunnable"></a>
1491
1306
 
1492
- <a name="Queueable+isReady"></a>
1307
+ ### Runnable.isRunnable(thing) ⇒ <code>boolean</code>
1308
+ Check if a given thing is Runnable
1493
1309
 
1494
- ### queueable.isReady <code>boolean</code>
1495
- Check ready state.
1310
+ **Kind**: static method of [<code>Runnable</code>](#Runnable)
1496
1311
 
1497
- **Kind**: instance property of [<code>Queueable</code>](#Queueable)
1498
- <a name="Queueable+task"></a>
1312
+ | Param | Type |
1313
+ | --- | --- |
1314
+ | thing | <code>\*</code> |
1499
1315
 
1500
- ### queueable.task ⇒ <code>\*</code>
1501
- Retrieve the data which should be formed as a task.
1316
+ <a name="TreeLinkerIterator"></a>
1502
1317
 
1503
- **Kind**: instance property of [<code>Queueable</code>](#Queueable)
1504
- <a name="Queueable+markCompleted"></a>
1318
+ ## TreeLinkerIterator
1319
+ Class TreeLinkerIterator returns the next value taking a left-first approach down a tree.
1505
1320
 
1506
- ### queueable.markCompleted(completeResponse) ⇒ <code>completeResponse</code>
1507
- Set this queueable as completed.
1321
+ **Kind**: global class
1322
+ <a name="Arrayable"></a>
1508
1323
 
1509
- **Kind**: instance method of [<code>Queueable</code>](#Queueable)
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
- | completeResponse | <code>Object</code> | | |
1514
- | [completeResponse.success] | <code>\*</code> | <code>true</code> | Indicate when the task failed (use false) or give a success message |
1515
- | [completeResponse.error] | <code>\*</code> | <code>false</code> | Indicate a task was error-free (use false) or give an error message |
1516
- | [completeResponse.context] | <code>\*</code> | <code></code> | Provide additional data in the response |
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.&lt;ArrayElement&gt;</code>](#ArrayElement) | <code>Arrayable</code> | Provide the type of IsArrayable to use. |
1517
1334
 
1518
- <a name="Queueable+run"></a>
1519
1335
 
1520
- ### queueable.run() ⇒ <code>completeResponse</code>
1521
- Intend to run the queued task when it is ready. If ready, mark this task as running and run the task.
1336
+ * [Arrayable](#Arrayable) ⇒ [<code>Arrayable</code>](#Arrayable)
1337
+ * [new Arrayable()](#new_Arrayable_new)
1338
+ * [.list](#Arrayable+list) ⇒ [<code>Array.&lt;ArrayElement&gt;</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
- **Kind**: instance method of [<code>Queueable</code>](#Queueable)
1524
- <a name="Queueable.fromArray"></a>
1351
+ <a name="new_Arrayable_new"></a>
1525
1352
 
1526
- ### Queueable.fromArray(values, [classType]) ⇒ <code>Object</code>
1527
- Convert an array into Queueable instances, return the head and tail Queueables.
1353
+ ### new Arrayable()
1354
+ Create the new Arrayable instance, configure the Arrayable class.
1528
1355
 
1529
- **Kind**: static method of [<code>Queueable</code>](#Queueable)
1356
+ <a name="Arrayable+list"></a>
1530
1357
 
1531
- | Param | Type | Default | Description |
1532
- | --- | --- | --- | --- |
1533
- | values | <code>Array</code> | | Provide an array of data that will be converted to a chain of queueable linkers. |
1534
- | [classType] | <code>IsLinker</code> | <code>Queueable</code> | Provide the type of IsLinker to use. |
1358
+ ### arrayable.list [<code>Array.&lt;ArrayElement&gt;</code>](#ArrayElement)
1359
+ Retrieve a copy of the innerList used.
1535
1360
 
1536
- <a name="Queue"></a>
1361
+ **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
1362
+ <a name="Arrayable+first"></a>
1537
1363
 
1538
- ## Queue ⇒ [<code>Queue</code>](#Queue)
1539
- Convert an array to a Queue.
1364
+ ### arrayable.first ⇒ [<code>ArrayElement</code>](#ArrayElement)
1365
+ Retrieve the first Element from the Arrayable
1540
1366
 
1541
- **Kind**: global variable
1367
+ **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
1368
+ <a name="Arrayable+last"></a>
1542
1369
 
1543
- | Param | Type | Description |
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
- * [Queue](#Queue)[<code>Queue</code>](#Queue)
1551
- * [new Queue(queuedList, listClass, queueableClass)](#new_Queue_new)
1552
- * [.dequeue()](#Queue+dequeue) ⇒ <code>completeResponse</code> \| <code>\*</code>
1553
- * [.empty()](#Queue+empty) ⇒ <code>boolean</code>
1554
- * [.enqueue(queueable)](#Queue+enqueue)
1555
- * [.peek()](#Queue+peek) ⇒ [<code>Queueable</code>](#Queueable)
1556
- * [.remove()](#Queue+remove) ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
1557
- * [.size()](#Queue+size) ⇒ <code>number</code>
1376
+ ### arrayable.length ⇒ <code>number</code>
1377
+ Return the length of the list.
1558
1378
 
1559
- <a name="new_Queue_new"></a>
1379
+ **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
1380
+ <a name="Arrayable+initialize"></a>
1560
1381
 
1561
- ### new Queue(queuedList, listClass, queueableClass)
1562
- Instantiate the queue with the given queue list.
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
- | queuedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) | Give the list of queueables to start in this queue. |
1568
- | listClass | <code>IsArrayable</code> | |
1569
- | queueableClass | [<code>Queueable</code>](#Queueable) | |
1389
+ | initialList | [<code>Array.&lt;ArrayElement&gt;</code>](#ArrayElement) | Give the array of elements to start in this Arrayable. |
1570
1390
 
1571
- <a name="Queue+dequeue"></a>
1391
+ <a name="Arrayable+insertAfter"></a>
1572
1392
 
1573
- ### queue.dequeue() ⇒ <code>completeResponse</code> \| <code>\*</code>
1574
- Take a queued task from the front of the queue and run it if ready.
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>Queue</code>](#Queue)
1577
- <a name="Queue+empty"></a>
1396
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
1578
1397
 
1579
- ### queue.empty() <code>boolean</code>
1580
- Return true if the queue is empty (there are no tasks in the queue list)
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
- **Kind**: instance method of [<code>Queue</code>](#Queue)
1583
- <a name="Queue+enqueue"></a>
1403
+ <a name="Arrayable+insertBefore"></a>
1584
1404
 
1585
- ### queue.enqueue(queueable)
1586
- Add a queued task to the end of the queue
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>Queue</code>](#Queue)
1408
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
1589
1409
 
1590
1410
  | Param | Type | Description |
1591
1411
  | --- | --- | --- |
1592
- | queueable | [<code>Queueable</code>](#Queueable) | Add a new queueable to the end of the queue |
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="Queue+peek"></a>
1415
+ <a name="Arrayable+append"></a>
1595
1416
 
1596
- ### queue.peek() ⇒ [<code>Queueable</code>](#Queueable)
1597
- Take a look at the next queued task
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>Queue</code>](#Queue)
1600
- <a name="Queue+remove"></a>
1420
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
1601
1421
 
1602
- ### queue.remove() [<code>Queueable</code>](#Queueable) \| <code>null</code>
1603
- Remove the next queued item and return it.
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
- **Kind**: instance method of [<code>Queue</code>](#Queue)
1606
- <a name="Queue+size"></a>
1427
+ <a name="Arrayable+prepend"></a>
1607
1428
 
1608
- ### queue.size() ⇒ <code>number</code>
1609
- Get the length of the current queue.
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>Queue</code>](#Queue)
1612
- <a name="TreeLinker"></a>
1432
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
1613
1433
 
1614
- ## TreeLinker [<code>TreeLinker</code>](#TreeLinker)
1615
- Make a new DoubleLinker from the data given if it is not already a valid Linker.
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
- **Kind**: global variable
1439
+ <a name="Arrayable+remove"></a>
1618
1440
 
1619
- | Param | Type | Default | Description |
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
- * [TreeLinker](#TreeLinker) [<code>TreeLinker</code>](#TreeLinker)
1626
- * [new TreeLinker([settings], listClass)](#new_TreeLinker_new)
1627
- * _instance_
1628
- * [.childrenFromArray(children, listClass)](#TreeLinker+childrenFromArray) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
1629
- * _static_
1630
- * [.fromArray([values], [classType])](#TreeLinker.fromArray) ⇒ <code>Object</code>
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="new_TreeLinker_new"></a>
1450
+ <a name="Arrayable+item"></a>
1633
1451
 
1634
- ### new TreeLinker([settings], listClass)
1635
- Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.
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 | Default | Description |
1639
- | --- | --- | --- | --- |
1640
- | [settings] | <code>Object</code> | <code>{}</code> | |
1641
- | [settings.data] | <code>\*</code> | <code></code> | The data to be stored in this tree node |
1642
- | [settings.next] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to the next linker if any |
1643
- | [settings.prev] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to the previous linker if any |
1644
- | [settings.children] | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code></code> | The references to child linkers if any |
1645
- | [settings.parent] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> | The reference to a parent linker if any |
1646
- | listClass | <code>IsArrayable.&lt;IsTreeNode&gt;</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="TreeLinker+childrenFromArray"></a>
1461
+ <a name="Arrayable+forEach"></a>
1649
1462
 
1650
- ### treeLinker.childrenFromArray(children, listClass) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
1651
- Create the children for this tree from an array.
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>TreeLinker</code>](#TreeLinker)
1466
+ **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
1654
1467
 
1655
1468
  | Param | Type | Description |
1656
1469
  | --- | --- | --- |
1657
- | children | <code>Array</code> \| <code>null</code> | Provide an array of data / linker references to be children of this tree node. |
1658
- | listClass | <code>IsArrayable.&lt;IsTreeNode&gt;</code> | Give the type of list to use for storing the children |
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="TreeLinker.fromArray"></a>
1473
+ <a name="ArrayElement"></a>
1661
1474
 
1662
- ### TreeLinker.fromArray([values], [classType]) ⇒ <code>Object</code>
1663
- Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
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**: static method of [<code>TreeLinker</code>](#TreeLinker)
1478
+ **Kind**: global variable
1666
1479
 
1667
1480
  | Param | Type | Default | Description |
1668
1481
  | --- | --- | --- | --- |
1669
- | [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of tree-linkers. |
1670
- | [classType] | <code>IsTreeNode</code> | <code>TreeLinker</code> | Provide the type of IsTreeNode to use. |
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
- ## LinkedTreeList ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
1675
- Convert an array into a LinkedTreeList instance, return the new instance.
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
- **Kind**: global variable
1490
+ <a name="new_ArrayElement_new"></a>
1678
1491
 
1679
- | Param | Type | Default | Description |
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.&lt;TreeLinker&gt;</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
- * [LinkedTreeList](#LinkedTreeList) [<code>LinkedTreeList</code>](#LinkedTreeList)
1687
- * [new LinkedTreeList()](#new_LinkedTreeList_new)
1688
- * [.list](#LinkedTreeList+list) [<code>TreeLinker</code>](#TreeLinker)
1689
- * [.first](#LinkedTreeList+first) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1690
- * [.last](#LinkedTreeList+last) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1691
- * [.length](#LinkedTreeList+length) ⇒ <code>number</code>
1692
- * [.parent](#LinkedTreeList+parent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1693
- * [.parent](#LinkedTreeList+parent)
1694
- * [.rootParent](#LinkedTreeList+rootParent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1695
- * [.initialize(initialList)](#LinkedTreeList+initialize) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
1696
- * [.setChildren(item, children)](#LinkedTreeList+setChildren)
1697
- * [.insertAfter(node, newNode)](#LinkedTreeList+insertAfter) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
1698
- * [.insertBefore(node, newNode)](#LinkedTreeList+insertBefore) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
1699
- * [.append(node, after)](#LinkedTreeList+append) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1700
- * [.prepend(node, before)](#LinkedTreeList+prepend) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1701
- * [.remove(node)](#LinkedTreeList+remove) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1702
- * [.reset()](#LinkedTreeList+reset) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1703
- * [.item(index)](#LinkedTreeList+item) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
1704
- * [.forEach(callback, thisArg)](#LinkedTreeList+forEach)
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="new_LinkedTreeList_new"></a>
1500
+ <a name="ArrayElement.fromArray"></a>
1707
1501
 
1708
- ### new LinkedTreeList()
1709
- Create the new LinkedTreeList instance, configure the list class.
1502
+ ### ArrayElement.fromArray([values], [classType]) ⇒ <code>Object</code>
1503
+ Convert an array into Element instances, return the head and tail Elements.
1710
1504
 
1711
- <a name="LinkedTreeList+list"></a>
1505
+ **Kind**: static method of [<code>ArrayElement</code>](#ArrayElement)
1712
1506
 
1713
- ### linkedTreeList.list [<code>TreeLinker</code>](#TreeLinker)
1714
- Retrieve a copy of the innerList used.
1507
+ | Param | Type | Default | Description |
1508
+ | --- | --- | --- | --- |
1509
+ | [values] | <code>Array.&lt;IsElement&gt;</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
- **Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
1717
- **Overrides**: [<code>list</code>](#DoublyLinkedList+list)
1718
- <a name="LinkedTreeList+first"></a>
1512
+ <a name="DoubleLinker"></a>
1719
1513
 
1720
- ### linkedTreeList.first ⇒ [<code>TreeLinker</code>](#TreeLinker)
1721
- Retrieve the first TreeLinker in the list.
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**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
1724
- **Overrides**: [<code>first</code>](#DoublyLinkedList+first)
1725
- <a name="LinkedTreeList+last"></a>
1517
+ **Kind**: global variable
1726
1518
 
1727
- ### linkedTreeList.last [<code>TreeLinker</code>](#TreeLinker)
1728
- Retrieve the last TreeLinker in the list.
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
- ### linkedTreeList.length ⇒ <code>number</code>
1735
- Return the length of the list.
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
- **Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
1738
- **Overrides**: [<code>length</code>](#DoublyLinkedList+length)
1739
- <a name="LinkedTreeList+parent"></a>
1529
+ <a name="new_DoubleLinker_new"></a>
1740
1530
 
1741
- ### linkedTreeList.parent [<code>TreeLinker</code>](#TreeLinker)
1742
- Get the parent of this tree list.
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
- ### linkedTreeList.parent
1748
- Set the parent of this tree list
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
- **Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
1542
+ <a name="DoubleLinker.fromArray"></a>
1751
1543
 
1752
- | Param | Type | Description |
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
- <a name="LinkedTreeList+rootParent"></a>
1547
+ **Kind**: static method of [<code>DoubleLinker</code>](#DoubleLinker)
1757
1548
 
1758
- ### linkedTreeList.rootParent [<code>TreeLinker</code>](#TreeLinker)
1759
- Return the root parent of the entire tree.
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
- **Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
1762
- <a name="LinkedTreeList+initialize"></a>
1554
+ <a name="DoublyLinkedList"></a>
1763
1555
 
1764
- ### linkedTreeList.initialize(initialList) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
1765
- Initialize the inner list, should only run once.
1556
+ ## DoublyLinkedList ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
1557
+ Convert an array into a DoublyLinkedList instance, return the new instance.
1766
1558
 
1767
- **Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
1768
- **Overrides**: [<code>initialize</code>](#DoublyLinkedList+initialize)
1559
+ **Kind**: global variable
1769
1560
 
1770
- | Param | Type | Description |
1771
- | --- | --- | --- |
1772
- | initialList | [<code>TreeLinker</code>](#TreeLinker) | Give the list of tree-linkers to start in this linked-tree-list. |
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.&lt;IsDoubleLinker&gt;</code> | <code>LinkedList</code> | Provide the type of IsArrayable to use. |
1773
1566
 
1774
- <a name="LinkedTreeList+setChildren"></a>
1775
1567
 
1776
- ### linkedTreeList.setChildren(item, children)
1777
- Set the children on a parent item.
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
- **Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
1584
+ <a name="new_DoublyLinkedList_new"></a>
1780
1585
 
1781
- | Param | Type | Description |
1782
- | --- | --- | --- |
1783
- | item | [<code>TreeLinker</code>](#TreeLinker) | The TreeLinker node that will be the parent of the children |
1784
- | children | [<code>LinkedTreeList</code>](#LinkedTreeList) | The LinkedTreeList which has the child nodes to use |
1586
+ ### new DoublyLinkedList()
1587
+ Create the new DoublyLinkedList instance.
1785
1588
 
1786
- <a name="LinkedTreeList+insertAfter"></a>
1589
+ <a name="DoublyLinkedList+list"></a>
1787
1590
 
1788
- ### linkedTreeList.insertAfter(node, newNode) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
1789
- Insert a new node (or data) after a node.
1591
+ ### doublyLinkedList.list ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
1592
+ Retrieve a copy of the innerList used.
1790
1593
 
1791
- **Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
1792
- **Overrides**: [<code>insertAfter</code>](#DoublyLinkedList+insertAfter)
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
- | Param | Type | Description |
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
- <a name="LinkedTreeList+insertBefore"></a>
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
- ### linkedTreeList.insertBefore(node, newNode) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList)
1802
- Insert a new node (or data) before a node.
1605
+ ### doublyLinkedList.last ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
1606
+ Retrieve the last DoubleLinker in the list.
1803
1607
 
1804
- **Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
1805
- **Overrides**: [<code>insertBefore</code>](#DoublyLinkedList+insertBefore)
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
- | Param | Type | Description |
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
- <a name="LinkedTreeList+append"></a>
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
- ### linkedTreeList.append(node, after) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1815
- Add a node (or data) after the given (or last) node in the list.
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>LinkedTreeList</code>](#LinkedTreeList)
1818
- **Overrides**: [<code>append</code>](#DoublyLinkedList+append)
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
- | node | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to add to the end of the list |
1823
- | after | [<code>TreeLinker</code>](#TreeLinker) | The existing last node |
1627
+ | initialList | [<code>DoubleLinker</code>](#DoubleLinker) | Give the list of double-linkers to start in this doubly linked-list. |
1824
1628
 
1825
- <a name="LinkedTreeList+prepend"></a>
1629
+ <a name="DoublyLinkedList+insertAfter"></a>
1826
1630
 
1827
- ### linkedTreeList.prepend(node, before) ⇒ [<code>TreeLinker</code>](#TreeLinker)
1828
- Add a node (or data) before the given (or first) node in the list.
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>LinkedTreeList</code>](#LinkedTreeList)
1831
- **Overrides**: [<code>prepend</code>](#DoublyLinkedList+prepend)
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>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | The new node to add to the start of the list |
1836
- | before | [<code>TreeLinker</code>](#TreeLinker) | The existing first node |
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
- **Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
1844
- **Overrides**: [<code>remove</code>](#DoublyLinkedList+remove)
1642
+ <a name="DoublyLinkedList+insertBefore"></a>
1845
1643
 
1846
- | Param | Type | Description |
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
- <a name="LinkedTreeList+reset"></a>
1647
+ **Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
1648
+ **Overrides**: [<code>insertBefore</code>](#LinkedList+insertBefore)
1851
1649
 
1852
- ### linkedTreeList.reset() [<code>TreeLinker</code>](#TreeLinker)
1853
- Refresh all references and return head reference.
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
- **Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
1856
- **Overrides**: [<code>reset</code>](#DoublyLinkedList+reset)
1857
- <a name="LinkedTreeList+item"></a>
1655
+ <a name="DoublyLinkedList+append"></a>
1858
1656
 
1859
- ### linkedTreeList.item(index) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
1860
- Retrieve a TreeLinker item from this list by numeric index, otherwise return null.
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>LinkedTreeList</code>](#LinkedTreeList)
1863
- **Overrides**: [<code>item</code>](#DoublyLinkedList+item)
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
- | index | <code>number</code> | The integer number for retrieving a node by position. |
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="LinkedTreeList+forEach"></a>
1668
+ <a name="DoublyLinkedList+prepend"></a>
1870
1669
 
1871
- ### linkedTreeList.forEach(callback, thisArg)
1872
- Be able to run forEach on this LinkedTreeList to iterate over the TreeLinker Items.
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>LinkedTreeList</code>](#LinkedTreeList)
1875
- **Overrides**: [<code>forEach</code>](#DoublyLinkedList+forEach)
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
- | callback | <code>forEachCallback</code> | The function to call for-each tree node |
1880
- | thisArg | [<code>LinkedTreeList</code>](#LinkedTreeList) | Optional, 'this' reference |
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="Linker"></a>
1681
+ <a name="DoublyLinkedList+remove"></a>
1883
1682
 
1884
- ## Linker ⇒ [<code>Linker</code>](#Linker)
1885
- Make a new Linker from the data given if it is not already a valid Linker.
1683
+ ### doublyLinkedList.remove(node) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
1684
+ Remove a linker from this linked list.
1886
1685
 
1887
- **Kind**: global variable
1686
+ **Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
1687
+ **Overrides**: [<code>remove</code>](#LinkedList+remove)
1888
1688
 
1889
- | Param | Type | Default | Description |
1890
- | --- | --- | --- | --- |
1891
- | linker | [<code>Linker</code>](#Linker) \| <code>\*</code> | | Return a valid Linker instance from given data, or even an already valid one. |
1892
- | [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
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
- * [Linker](#Linker) ⇒ [<code>Linker</code>](#Linker)
1896
- * [new Linker([nodeData])](#new_Linker_new)
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
- <a name="new_Linker_new"></a>
1698
+ **Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
1699
+ <a name="DoublyLinkedList+item"></a>
1900
1700
 
1901
- ### new Linker([nodeData])
1902
- Create the new Linker instance, provide the data and optionally give the next Linker.
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 | Default | Description |
1906
- | --- | --- | --- | --- |
1907
- | [nodeData] | <code>Object</code> | <code>{}</code> | |
1908
- | [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
1909
- | [nodeData.next] | [<code>Linker</code>](#Linker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
1707
+ | Param | Type | Description |
1708
+ | --- | --- | --- |
1709
+ | index | <code>number</code> | The integer number for retrieving a node by position. |
1910
1710
 
1911
- <a name="Linker.fromArray"></a>
1711
+ <a name="DoublyLinkedList+forEach"></a>
1912
1712
 
1913
- ### Linker.fromArray([values], [classType]) ⇒ <code>Object</code>
1914
- Convert an array into Linker instances, return the head and tail Linkers.
1713
+ ### doublyLinkedList.forEach(callback, thisArg)
1714
+ Be able to run forEach on this DoublyLinkedList to iterate over the DoubleLinker Items.
1915
1715
 
1916
- **Kind**: static method of [<code>Linker</code>](#Linker)
1716
+ **Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
1717
+ **Overrides**: [<code>forEach</code>](#LinkedList+forEach)
1917
1718
 
1918
- | Param | Type | Default | Description |
1919
- | --- | --- | --- | --- |
1920
- | [values] | <code>Array</code> | <code>[]</code> | Provide an array of data that will be converted to a chain of linkers. |
1921
- | [classType] | <code>IsLinker</code> | <code>Linker</code> | Provide the type of IsLinker to use. |
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="DoublyLinkedList"></a>
1887
+ <a name="Linker"></a>
2087
1888
 
2088
- ## DoublyLinkedList ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2089
- Convert an array into a DoublyLinkedList instance, return the new instance.
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
- | [values] | <code>Array</code> | <code>[]</code> | An array of values which will be converted to linkers in this doubly-linked-list |
2096
- | [linkerClass] | <code>IsDoubleLinker</code> | <code>DoubleLinker</code> | The class to use for each linker |
2097
- | [classType] | <code>IsArrayable.&lt;IsDoubleLinker&gt;</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
- * [DoublyLinkedList](#DoublyLinkedList) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2101
- * [new DoublyLinkedList()](#new_DoublyLinkedList_new)
2102
- * [.list](#DoublyLinkedList+list) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2103
- * [.first](#DoublyLinkedList+first) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2104
- * [.last](#DoublyLinkedList+last) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2105
- * [.length](#DoublyLinkedList+length) ⇒ <code>number</code>
2106
- * [.initialize(initialList)](#DoublyLinkedList+initialize) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2107
- * [.insertAfter(node, newNode)](#DoublyLinkedList+insertAfter) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2108
- * [.insertBefore(node, newNode)](#DoublyLinkedList+insertBefore) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2109
- * [.append(node, after)](#DoublyLinkedList+append) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2110
- * [.prepend(node, before)](#DoublyLinkedList+prepend) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2111
- * [.remove(node)](#DoublyLinkedList+remove) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2112
- * [.reset()](#DoublyLinkedList+reset) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2113
- * [.item(index)](#DoublyLinkedList+item) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
2114
- * [.forEach(callback, thisArg)](#DoublyLinkedList+forEach)
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="new_DoublyLinkedList_new"></a>
1904
+ <a name="new_Linker_new"></a>
2117
1905
 
2118
- ### new DoublyLinkedList()
2119
- Create the new DoublyLinkedList instance.
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
- ### doublyLinkedList.list [<code>DoubleLinker</code>](#DoubleLinker)
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.&lt;TreeLinker&gt;</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>DoublyLinkedList</code>](#DoublyLinkedList)
2127
- **Overrides**: [<code>list</code>](#LinkedList+list)
2128
- <a name="DoublyLinkedList+first"></a>
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
- ### doublyLinkedList.first ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2131
- Retrieve the first DoubleLinker in the list.
1976
+ ### linkedTreeList.first ⇒ [<code>TreeLinker</code>](#TreeLinker)
1977
+ Retrieve the first TreeLinker in the list.
2132
1978
 
2133
- **Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2134
- **Overrides**: [<code>first</code>](#LinkedList+first)
2135
- <a name="DoublyLinkedList+last"></a>
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
- ### doublyLinkedList.last ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2138
- Retrieve the last DoubleLinker in the list.
1983
+ ### linkedTreeList.last ⇒ [<code>TreeLinker</code>](#TreeLinker)
1984
+ Retrieve the last TreeLinker in the list.
2139
1985
 
2140
- **Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2141
- **Overrides**: [<code>last</code>](#LinkedList+last)
2142
- <a name="DoublyLinkedList+length"></a>
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
- ### doublyLinkedList.length ⇒ <code>number</code>
1990
+ ### linkedTreeList.length ⇒ <code>number</code>
2145
1991
  Return the length of the list.
2146
1992
 
2147
- **Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2148
- **Overrides**: [<code>length</code>](#LinkedList+length)
2149
- <a name="DoublyLinkedList+initialize"></a>
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
- ### doublyLinkedList.initialize(initialList) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
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>DoublyLinkedList</code>](#DoublyLinkedList)
2155
- **Overrides**: [<code>initialize</code>](#LinkedList+initialize)
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
- | initialList | [<code>DoubleLinker</code>](#DoubleLinker) | Give the list of double-linkers to start in this doubly linked-list. |
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="DoublyLinkedList+insertAfter"></a>
2042
+ <a name="LinkedTreeList+insertAfter"></a>
2162
2043
 
2163
- ### doublyLinkedList.insertAfter(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
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>DoublyLinkedList</code>](#DoublyLinkedList)
2167
- **Overrides**: [<code>insertAfter</code>](#LinkedList+insertAfter)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The existing node as reference |
2172
- | newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to go after the existing node |
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="DoublyLinkedList+insertBefore"></a>
2055
+ <a name="LinkedTreeList+insertBefore"></a>
2175
2056
 
2176
- ### doublyLinkedList.insertBefore(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
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>DoublyLinkedList</code>](#DoublyLinkedList)
2180
- **Overrides**: [<code>insertBefore</code>](#LinkedList+insertBefore)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The existing node as reference |
2185
- | newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to go before the existing node |
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="DoublyLinkedList+append"></a>
2068
+ <a name="LinkedTreeList+append"></a>
2188
2069
 
2189
- ### doublyLinkedList.append(node, after) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
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>DoublyLinkedList</code>](#DoublyLinkedList)
2193
- **Overrides**: [<code>append</code>](#LinkedList+append)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to add to the end of the list |
2198
- | after | [<code>DoubleLinker</code>](#DoubleLinker) | The existing last node |
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="DoublyLinkedList+prepend"></a>
2081
+ <a name="LinkedTreeList+prepend"></a>
2201
2082
 
2202
- ### doublyLinkedList.prepend(node, before) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
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>DoublyLinkedList</code>](#DoublyLinkedList)
2206
- **Overrides**: [<code>prepend</code>](#LinkedList+prepend)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | The new node to add to the start of the list |
2211
- | before | [<code>DoubleLinker</code>](#DoubleLinker) | The existing first node |
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="DoublyLinkedList+remove"></a>
2094
+ <a name="LinkedTreeList+remove"></a>
2214
2095
 
2215
- ### doublyLinkedList.remove(node) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
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>DoublyLinkedList</code>](#DoublyLinkedList)
2219
- **Overrides**: [<code>remove</code>](#LinkedList+remove)
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>DoubleLinker</code>](#DoubleLinker) | The node we wish to remove (and it will be returned after removal) |
2104
+ | node | [<code>TreeLinker</code>](#TreeLinker) | The node we wish to remove (and it will be returned after removal) |
2224
2105
 
2225
- <a name="DoublyLinkedList+reset"></a>
2106
+ <a name="LinkedTreeList+reset"></a>
2226
2107
 
2227
- ### doublyLinkedList.reset() ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2108
+ ### linkedTreeList.reset() ⇒ [<code>TreeLinker</code>](#TreeLinker)
2228
2109
  Refresh all references and return head reference.
2229
2110
 
2230
- **Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
2231
- <a name="DoublyLinkedList+item"></a>
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
- ### doublyLinkedList.item(index) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
2234
- Retrieve a DoubleLinker item from this list by numeric index, otherwise return null.
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>DoublyLinkedList</code>](#DoublyLinkedList)
2237
- **Overrides**: [<code>item</code>](#LinkedList+item)
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="DoublyLinkedList+forEach"></a>
2125
+ <a name="LinkedTreeList+forEach"></a>
2244
2126
 
2245
- ### doublyLinkedList.forEach(callback, thisArg)
2246
- Be able to run forEach on this DoublyLinkedList to iterate over the DoubleLinker Items.
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>DoublyLinkedList</code>](#DoublyLinkedList)
2249
- **Overrides**: [<code>forEach</code>](#LinkedList+forEach)
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 double linker |
2254
- | thisArg | [<code>DoublyLinkedList</code>](#DoublyLinkedList) | Optional, 'this' reference |
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="DoubleLinker"></a>
2138
+ <a name="TreeLinker"></a>
2257
2139
 
2258
- ## DoubleLinker ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
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>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | | Return a valid Linker instance from given data, or even an already valid one. |
2266
- | [classType] | <code>IsDoubleLinker</code> | <code>DoubleLinker</code> | Provide the type of IsDoubleLinker to use. |
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
- * [DoubleLinker](#DoubleLinker) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
2270
- * [new DoubleLinker([nodeData])](#new_DoubleLinker_new)
2271
- * [.fromArray([values], [classType])](#DoubleLinker.fromArray) ⇒ <code>Object</code>
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="new_DoubleLinker_new"></a>
2158
+ <a name="new_TreeLinker_new"></a>
2274
2159
 
2275
- ### new DoubleLinker([nodeData])
2276
- Create the new DoubleLinker instance, provide the data and optionally the next and prev references.
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
- | [nodeData] | <code>Object</code> | <code>{}</code> | |
2282
- | [nodeData.data] | <code>\*</code> | <code></code> | The data to be stored in this linker |
2283
- | [nodeData.next] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> | The reference to the next linker if any |
2284
- | [nodeData.prev] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> | The reference to the previous linker if any |
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.&lt;IsTreeNode&gt;</code> | | Give the type of list to use for storing the children |
2285
2173
 
2286
- <a name="DoubleLinker.fromArray"></a>
2174
+ <a name="TreeLinker+childrenFromArray"></a>
2287
2175
 
2288
- ### DoubleLinker.fromArray([values], [classType]) <code>Object</code>
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.&lt;IsTreeNode&gt;</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>DoubleLinker</code>](#DoubleLinker)
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>IsDoubleLinker</code> | <code>DoubleLinker</code> | Provide the type of IsDoubleLinker to use. |
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="Arrayable"></a>
2198
+ <a name="Queue"></a>
2299
2199
 
2300
- ## Arrayable ⇒ [<code>Arrayable</code>](#Arrayable)
2301
- Convert an array to an Arrayable.
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
- | values | <code>Array</code> | | An array of values which will be converted to elements in this arrayable |
2308
- | [elementClass] | <code>IsElement</code> | <code>ArrayElement</code> | The class to use for each element |
2309
- | [classType] | [<code>IsArrayable.&lt;ArrayElement&gt;</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
- * [Arrayable](#Arrayable) ⇒ [<code>Arrayable</code>](#Arrayable)
2313
- * [new Arrayable()](#new_Arrayable_new)
2314
- * [.list](#Arrayable+list) ⇒ [<code>Array.&lt;ArrayElement&gt;</code>](#ArrayElement)
2315
- * [.first](#Arrayable+first) ⇒ [<code>ArrayElement</code>](#ArrayElement)
2316
- * [.last](#Arrayable+last) ⇒ [<code>ArrayElement</code>](#ArrayElement)
2317
- * [.length](#Arrayable+length) ⇒ <code>number</code>
2318
- * [.initialize(initialList)](#Arrayable+initialize) ⇒ [<code>Arrayable</code>](#Arrayable)
2319
- * [.insertAfter(node, newNode)](#Arrayable+insertAfter) ⇒ [<code>Arrayable</code>](#Arrayable)
2320
- * [.insertBefore(node, newNode)](#Arrayable+insertBefore) ⇒ [<code>Arrayable</code>](#Arrayable)
2321
- * [.append(node, after)](#Arrayable+append) ⇒ [<code>Arrayable</code>](#Arrayable)
2322
- * [.prepend(node, before)](#Arrayable+prepend) ⇒ [<code>Arrayable</code>](#Arrayable)
2323
- * [.remove(node)](#Arrayable+remove) ⇒ [<code>ArrayElement</code>](#ArrayElement)
2324
- * [.item(index)](#Arrayable+item) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
2325
- * [.forEach(callback, thisArg)](#Arrayable+forEach) ⇒ [<code>Arrayable</code>](#Arrayable)
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="new_Arrayable_new"></a>
2297
+ <a name="new_Queueable_new"></a>
2328
2298
 
2329
- ### new Arrayable()
2330
- Create the new Arrayable instance, configure the Arrayable class.
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
- ### arrayable.list [<code>Array.&lt;ArrayElement&gt;</code>](#ArrayElement)
2335
- Retrieve a copy of the innerList used.
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
- **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
2338
- <a name="Arrayable+first"></a>
2310
+ <a name="Queueable+isReady"></a>
2339
2311
 
2340
- ### arrayable.first[<code>ArrayElement</code>](#ArrayElement)
2341
- Retrieve the first Element from the Arrayable
2312
+ ### queueable.isReady ⇒ <code>boolean</code>
2313
+ Check ready state.
2342
2314
 
2343
- **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
2344
- <a name="Arrayable+last"></a>
2315
+ **Kind**: instance property of [<code>Queueable</code>](#Queueable)
2316
+ <a name="Queueable+task"></a>
2345
2317
 
2346
- ### arrayable.last[<code>ArrayElement</code>](#ArrayElement)
2347
- Retrieve the last Element from the Arrayable
2318
+ ### queueable.task ⇒ <code>\*</code>
2319
+ Retrieve the data which should be formed as a task.
2348
2320
 
2349
- **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
2350
- <a name="Arrayable+length"></a>
2321
+ **Kind**: instance property of [<code>Queueable</code>](#Queueable)
2322
+ <a name="Queueable+markCompleted"></a>
2351
2323
 
2352
- ### arrayable.length ⇒ <code>number</code>
2353
- Return the length of the list.
2324
+ ### queueable.markCompleted(completeResponse) ⇒ <code>completeResponse</code>
2325
+ Set this queueable as completed.
2354
2326
 
2355
- **Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
2356
- <a name="Arrayable+initialize"></a>
2327
+ **Kind**: instance method of [<code>Queueable</code>](#Queueable)
2357
2328
 
2358
- ### arrayable.initialize(initialList) [<code>Arrayable</code>](#Arrayable)
2359
- Initialize the inner list, should only run once.
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
- **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
2336
+ <a name="Queueable+run"></a>
2362
2337
 
2363
- | Param | Type | Description |
2364
- | --- | --- | --- |
2365
- | initialList | [<code>Array.&lt;ArrayElement&gt;</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
- <a name="Arrayable+insertAfter"></a>
2341
+ **Kind**: instance method of [<code>Queueable</code>](#Queueable)
2342
+ <a name="Queueable.fromArray"></a>
2368
2343
 
2369
- ### arrayable.insertAfter(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
2370
- Insert a new node (or data) after a node.
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**: instance method of [<code>Arrayable</code>](#Arrayable)
2347
+ **Kind**: static method of [<code>Queueable</code>](#Queueable)
2373
2348
 
2374
- | Param | Type | Description |
2375
- | --- | --- | --- |
2376
- | node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
2377
- | newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go after the existing node |
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="Arrayable+insertBefore"></a>
2354
+ <a name="Stack"></a>
2380
2355
 
2381
- ### arrayable.insertBefore(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
2382
- Insert a new node (or data) before a node.
2356
+ ## Stack ⇒ [<code>Stack</code>](#Stack)
2357
+ Convert an array to a Stack.
2383
2358
 
2384
- **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
2359
+ **Kind**: global variable
2385
2360
 
2386
2361
  | Param | Type | Description |
2387
2362
  | --- | --- | --- |
2388
- | node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The existing node as reference |
2389
- | newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to go before the existing node |
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
- ### arrayable.append(node, after) ⇒ [<code>Arrayable</code>](#Arrayable)
2394
- Add a node (or data) after the given (or last) node in the list.
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
- **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
2377
+ <a name="new_Stack_new"></a>
2397
2378
 
2398
- | Param | Type | Description |
2399
- | --- | --- | --- |
2400
- | node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the end of the list |
2401
- | after | [<code>ArrayElement</code>](#ArrayElement) | The existing last node |
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
- ### arrayable.prepend(node, before) [<code>Arrayable</code>](#Arrayable)
2406
- Add a node (or data) before the given (or first) node in the list.
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
- **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
2389
+ <a name="Stack+empty"></a>
2409
2390
 
2410
- | Param | Type | Description |
2411
- | --- | --- | --- |
2412
- | node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | The new node to add to the start of the list |
2413
- | before | [<code>ArrayElement</code>](#ArrayElement) | The existing first node |
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
- <a name="Arrayable+remove"></a>
2394
+ **Kind**: instance method of [<code>Stack</code>](#Stack)
2395
+ <a name="Stack+top"></a>
2416
2396
 
2417
- ### arrayable.remove(node) ⇒ [<code>ArrayElement</code>](#ArrayElement)
2418
- Remove an element from this arrayable.
2397
+ ### stack.top() ⇒ [<code>Stackable</code>](#Stackable)
2398
+ Take a look at the next stacked task
2419
2399
 
2420
- **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
2400
+ **Kind**: instance method of [<code>Stack</code>](#Stack)
2401
+ <a name="Stack+pop"></a>
2421
2402
 
2422
- | Param | Type | Description |
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
- <a name="Arrayable+item"></a>
2406
+ **Kind**: instance method of [<code>Stack</code>](#Stack)
2407
+ <a name="Stack+push"></a>
2427
2408
 
2428
- ### arrayable.item(index) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
2429
- Retrieve an ArrayElement item from this list by numeric index, otherwise return null.
2409
+ ### stack.push(stackable)
2410
+ Push a stackable task to the top of the stack.
2430
2411
 
2431
- **Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
2412
+ **Kind**: instance method of [<code>Stack</code>](#Stack)
2432
2413
 
2433
2414
  | Param | Type | Description |
2434
2415
  | --- | --- | --- |
2435
- | index | <code>number</code> | The integer number for retrieving a node by position. |
2416
+ | stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> | Add a new stackable to the top of the stack |
2436
2417
 
2437
- <a name="Arrayable+forEach"></a>
2418
+ <a name="Stack+remove"></a>
2438
2419
 
2439
- ### arrayable.forEach(callback, thisArg) ⇒ [<code>Arrayable</code>](#Arrayable)
2440
- Be able to run forEach on this Arrayable to iterate over the elements.
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>Arrayable</code>](#Arrayable)
2423
+ **Kind**: instance method of [<code>Stack</code>](#Stack)
2424
+ <a name="Stack+size"></a>
2443
2425
 
2444
- | Param | Type | Description |
2445
- | --- | --- | --- |
2446
- | callback | <code>forEachCallback</code> | The function to call for-each element |
2447
- | thisArg | [<code>Arrayable</code>](#Arrayable) | Optional, 'this' reference |
2426
+ ### stack.size() <code>number</code>
2427
+ Get the size of the current stack.
2448
2428
 
2449
- <a name="ArrayElement"></a>
2429
+ **Kind**: instance method of [<code>Stack</code>](#Stack)
2430
+ <a name="Stackable"></a>
2450
2431
 
2451
- ## ArrayElement ⇒ [<code>ArrayElement</code>](#ArrayElement)
2452
- Make a new Element from the data given if it is not already a valid Element.
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
- | element | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | | Return a valid ArrayElement instance from given data, or even an already valid one. |
2459
- | [classType] | <code>IsElement</code> | <code>ArrayElement</code> | Provide the type of IsElement to use. |
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
- * [ArrayElement](#ArrayElement) ⇒ [<code>ArrayElement</code>](#ArrayElement)
2463
- * [new ArrayElement([data])](#new_ArrayElement_new)
2464
- * [.fromArray([values], [classType])](#ArrayElement.fromArray) ⇒ <code>Object</code>
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="new_ArrayElement_new"></a>
2451
+ <a name="new_Stackable_new"></a>
2467
2452
 
2468
- ### new ArrayElement([data])
2469
- Create the new Element instance, provide the data and optionally configure the type of Element.
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
- | [data] | <code>\*</code> | <code></code> | The data to be stored in this element. |
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="ArrayElement.fromArray"></a>
2464
+ <a name="Stackable+task"></a>
2477
2465
 
2478
- ### ArrayElement.fromArray([values], [classType]) ⇒ <code>Object</code>
2479
- Convert an array into Element instances, return the head and tail Elements.
2466
+ ### stackable.task ⇒ <code>\*</code>
2467
+ Retrieve the data which should be formed as a task.
2480
2468
 
2481
- **Kind**: static method of [<code>ArrayElement</code>](#ArrayElement)
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.&lt;IsElement&gt;</code> | <code>[]</code> | Provide an array of data that will be converted to array of elements. |
2486
- | [classType] | <code>IsElement</code> | <code>ArrayElement</code> | Provide the type of IsElement to use. |
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="recipes"></a>
2500
+ <a name="parseTree"></a>
2495
2501
 
2496
- ## recipes
2497
- List of class declarations that can be used to specify attributes for a style of object / class.
2502
+ ## parseTree(tree, callback) ⇒ <code>IsArrayable.&lt;IsTreeNode&gt;</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.&lt;IsTreeNode&gt;</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.&lt;IsTreeNode&gt;</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.&lt;IsTreeNode&gt;</code> |
2528
- | callback | <code>forEachCallback</code> |
2529
-