collect-your-stuff 1.0.0
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/LICENSE +674 -0
- package/README.md +1676 -0
- package/browser/collect-your-stuff.js +18987 -0
- package/browser/collect-your-stuff.min.js +1 -0
- package/dist/collections/arrayable/ArrayElement.js +95 -0
- package/dist/collections/arrayable/ArrayElement.min.js +1 -0
- package/dist/collections/arrayable/Arrayable.js +253 -0
- package/dist/collections/arrayable/Arrayable.min.js +1 -0
- package/dist/collections/doubly-linked-llist/DoubleLinker.js +90 -0
- package/dist/collections/doubly-linked-llist/DoubleLinker.min.js +1 -0
- package/dist/collections/doubly-linked-llist/DoublyLinkedList.js +234 -0
- package/dist/collections/doubly-linked-llist/DoublyLinkedList.min.js +1 -0
- package/dist/collections/linked-list/LinkedList.js +256 -0
- package/dist/collections/linked-list/LinkedList.min.js +1 -0
- package/dist/collections/linked-list/Linker.js +100 -0
- package/dist/collections/linked-list/Linker.min.js +1 -0
- package/dist/collections/linked-tree-list/LinkedTreeList.js +96 -0
- package/dist/collections/linked-tree-list/LinkedTreeList.min.js +1 -0
- package/dist/collections/linked-tree-list/TreeLinker.js +112 -0
- package/dist/collections/linked-tree-list/TreeLinker.min.js +1 -0
- package/dist/collections/queue/Queue.js +163 -0
- package/dist/collections/queue/Queue.min.js +1 -0
- package/dist/collections/queue/Queueable.js +177 -0
- package/dist/collections/queue/Queueable.min.js +1 -0
- package/dist/collections/stack/Stack.js +141 -0
- package/dist/collections/stack/Stack.min.js +1 -0
- package/dist/collections/stack/Stackable.js +85 -0
- package/dist/collections/stack/Stackable.min.js +1 -0
- package/dist/main.js +44 -0
- package/dist/main.min.js +1 -0
- package/dist/recipes/Runnable.js +67 -0
- package/dist/recipes/Runnable.min.js +1 -0
- package/dist/recipes/recipes.js +23 -0
- package/dist/recipes/recipes.min.js +1 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,1676 @@
|
|
|
1
|
+
# Collect your stuff (and go)
|
|
2
|
+
|
|
3
|
+
Data allocation and manipulation.
|
|
4
|
+
|
|
5
|
+
## Modules
|
|
6
|
+
|
|
7
|
+
<dl>
|
|
8
|
+
<dt><a href="#module_collect-your-stuff">collect-your-stuff</a></dt>
|
|
9
|
+
<dd><p>All of the collections available.</p>
|
|
10
|
+
</dd>
|
|
11
|
+
</dl>
|
|
12
|
+
|
|
13
|
+
## Classes
|
|
14
|
+
|
|
15
|
+
<dl>
|
|
16
|
+
<dt><a href="#Runnable">Runnable</a></dt>
|
|
17
|
+
<dd><p>Identify a class that can be run.</p>
|
|
18
|
+
</dd>
|
|
19
|
+
<dt><a href="#Stackable">Stackable</a> ⇐ <code><a href="#ArrayElement">ArrayElement</a></code></dt>
|
|
20
|
+
<dd><p>Stackable represents a runnable entry in stack.</p>
|
|
21
|
+
</dd>
|
|
22
|
+
<dt><a href="#Stack">Stack</a></dt>
|
|
23
|
+
<dd><p>Store a collection of items which can only be inserted and removed from the top.</p>
|
|
24
|
+
</dd>
|
|
25
|
+
<dt><a href="#Queueable">Queueable</a> ⇐ <code><a href="#Linker">Linker</a></code></dt>
|
|
26
|
+
<dd><p>Queueable represents a runnable entry in a queue.</p>
|
|
27
|
+
</dd>
|
|
28
|
+
<dt><a href="#Queue">Queue</a></dt>
|
|
29
|
+
<dd><p>Maintain a series of queued items.</p>
|
|
30
|
+
</dd>
|
|
31
|
+
<dt><a href="#TreeLinker">TreeLinker</a> ⇐ <code><a href="#DoubleLinker">DoubleLinker</a></code></dt>
|
|
32
|
+
<dd><p>TreeLinker represents a node in a LinkedTreeList.</p>
|
|
33
|
+
</dd>
|
|
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
|
+
</dd>
|
|
37
|
+
<dt><a href="#Linker">Linker</a> ⇐ <code><a href="#ArrayElement">ArrayElement</a></code></dt>
|
|
38
|
+
<dd><p>Linker represents a node in a LinkedList.</p>
|
|
39
|
+
</dd>
|
|
40
|
+
<dt><a href="#LinkedList">LinkedList</a> ⇐ <code><a href="#Arrayable">Arrayable</a></code></dt>
|
|
41
|
+
<dd><p>LinkedList represents a collection stored as a LinkedList with next references.</p>
|
|
42
|
+
</dd>
|
|
43
|
+
<dt><a href="#DoublyLinkedList">DoublyLinkedList</a> ⇐ <code><a href="#LinkedList">LinkedList</a></code></dt>
|
|
44
|
+
<dd><p>DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.</p>
|
|
45
|
+
</dd>
|
|
46
|
+
<dt><a href="#DoubleLinker">DoubleLinker</a> ⇐ <code><a href="#Linker">Linker</a></code></dt>
|
|
47
|
+
<dd><p>DoubleLinker represents a node in a DoublyLinkedList.</p>
|
|
48
|
+
</dd>
|
|
49
|
+
<dt><a href="#Arrayable">Arrayable</a></dt>
|
|
50
|
+
<dd><p>DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.</p>
|
|
51
|
+
</dd>
|
|
52
|
+
<dt><a href="#ArrayElement">ArrayElement</a></dt>
|
|
53
|
+
<dd><p>Element represents a node in an Arrayable.</p>
|
|
54
|
+
</dd>
|
|
55
|
+
</dl>
|
|
56
|
+
|
|
57
|
+
## Constants
|
|
58
|
+
|
|
59
|
+
<dl>
|
|
60
|
+
<dt><a href="#recipes">recipes</a> : <code>Object</code></dt>
|
|
61
|
+
<dd><p>List of class declarations that can be used to specify attributes for a style of object / class.</p>
|
|
62
|
+
</dd>
|
|
63
|
+
</dl>
|
|
64
|
+
|
|
65
|
+
## Typedefs
|
|
66
|
+
|
|
67
|
+
<dl>
|
|
68
|
+
<dt><a href="#completeResponse">completeResponse</a> : <code>Object</code></dt>
|
|
69
|
+
<dd><p>Return results of the task.</p>
|
|
70
|
+
</dd>
|
|
71
|
+
<dt><a href="#forEachCallback">forEachCallback</a> ⇒</dt>
|
|
72
|
+
<dd><p>Run this function for each element in this arrayable.</p>
|
|
73
|
+
</dd>
|
|
74
|
+
</dl>
|
|
75
|
+
|
|
76
|
+
<a name="module_collect-your-stuff"></a>
|
|
77
|
+
|
|
78
|
+
## collect-your-stuff
|
|
79
|
+
All of the collections available.
|
|
80
|
+
|
|
81
|
+
**Version**: 1.0.0
|
|
82
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
83
|
+
<a name="module_collect-your-stuff..collectYourStuff"></a>
|
|
84
|
+
|
|
85
|
+
### collect-your-stuff~collectYourStuff : [<code>collect-your-stuff</code>](#module_collect-your-stuff)
|
|
86
|
+
All methods exported from this module are encapsulated within collect-your-stuff.
|
|
87
|
+
|
|
88
|
+
**Kind**: inner typedef of [<code>collect-your-stuff</code>](#module_collect-your-stuff)
|
|
89
|
+
<a name="Runnable"></a>
|
|
90
|
+
|
|
91
|
+
## Runnable
|
|
92
|
+
Identify a class that can be run.
|
|
93
|
+
|
|
94
|
+
**Kind**: global class
|
|
95
|
+
|
|
96
|
+
* [Runnable](#Runnable)
|
|
97
|
+
* _instance_
|
|
98
|
+
* [.task](#Runnable+task) ⇒ <code>function</code>
|
|
99
|
+
* [.run()](#Runnable+run) ⇒ <code>\*</code>
|
|
100
|
+
* _static_
|
|
101
|
+
* [.isRunnable(thing)](#Runnable.isRunnable) ⇒ <code>boolean</code>
|
|
102
|
+
|
|
103
|
+
<a name="Runnable+task"></a>
|
|
104
|
+
|
|
105
|
+
### runnable.task ⇒ <code>function</code>
|
|
106
|
+
Retrieve the data which should be formed as a task.
|
|
107
|
+
|
|
108
|
+
**Kind**: instance property of [<code>Runnable</code>](#Runnable)
|
|
109
|
+
<a name="Runnable+run"></a>
|
|
110
|
+
|
|
111
|
+
### runnable.run() ⇒ <code>\*</code>
|
|
112
|
+
Run the runnable task.
|
|
113
|
+
|
|
114
|
+
**Kind**: instance method of [<code>Runnable</code>](#Runnable)
|
|
115
|
+
<a name="Runnable.isRunnable"></a>
|
|
116
|
+
|
|
117
|
+
### Runnable.isRunnable(thing) ⇒ <code>boolean</code>
|
|
118
|
+
Check if a given thing is Runnable
|
|
119
|
+
|
|
120
|
+
**Kind**: static method of [<code>Runnable</code>](#Runnable)
|
|
121
|
+
|
|
122
|
+
| Param | Type |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| thing | <code>\*</code> |
|
|
125
|
+
|
|
126
|
+
<a name="Stackable"></a>
|
|
127
|
+
|
|
128
|
+
## Stackable ⇐ [<code>ArrayElement</code>](#ArrayElement)
|
|
129
|
+
Stackable represents a runnable entry in stack.
|
|
130
|
+
|
|
131
|
+
**Kind**: global class
|
|
132
|
+
**Extends**: [<code>ArrayElement</code>](#ArrayElement), [<code>Runnable</code>](#Runnable)
|
|
133
|
+
|
|
134
|
+
* [Stackable](#Stackable) ⇐ [<code>ArrayElement</code>](#ArrayElement)
|
|
135
|
+
* [new Stackable([stack], stackableClass)](#new_Stackable_new)
|
|
136
|
+
* _instance_
|
|
137
|
+
* [.task](#Stackable+task) ⇒ <code>\*</code>
|
|
138
|
+
* [.classType](#ArrayElement+classType) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
139
|
+
* [.run()](#Stackable+run) ⇒ <code>\*</code>
|
|
140
|
+
* _static_
|
|
141
|
+
* [.make(stackable, [stackableClass])](#Stackable.make) ⇒ [<code>Stackable</code>](#Stackable)
|
|
142
|
+
* [.fromArray([values], [stackableClass])](#Stackable.fromArray) ⇒ <code>Object</code>
|
|
143
|
+
|
|
144
|
+
<a name="new_Stackable_new"></a>
|
|
145
|
+
|
|
146
|
+
### new Stackable([stack], stackableClass)
|
|
147
|
+
Instantiate the Stackable which is used in a stack.
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
| Param | Type | Default |
|
|
151
|
+
| --- | --- | --- |
|
|
152
|
+
| [stack] | <code>\*</code> | <code></code> |
|
|
153
|
+
| stackableClass | | |
|
|
154
|
+
|
|
155
|
+
<a name="Stackable+task"></a>
|
|
156
|
+
|
|
157
|
+
### stackable.task ⇒ <code>\*</code>
|
|
158
|
+
Retrieve the data which should be formed as a task.
|
|
159
|
+
|
|
160
|
+
**Kind**: instance property of [<code>Stackable</code>](#Stackable)
|
|
161
|
+
**Overrides**: [<code>task</code>](#Runnable+task)
|
|
162
|
+
<a name="ArrayElement+classType"></a>
|
|
163
|
+
|
|
164
|
+
### stackable.classType ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
165
|
+
Return the type of class used for Element.
|
|
166
|
+
|
|
167
|
+
**Kind**: instance property of [<code>Stackable</code>](#Stackable)
|
|
168
|
+
**Overrides**: [<code>classType</code>](#ArrayElement+classType)
|
|
169
|
+
<a name="Stackable+run"></a>
|
|
170
|
+
|
|
171
|
+
### stackable.run() ⇒ <code>\*</code>
|
|
172
|
+
Run the stacked task.
|
|
173
|
+
|
|
174
|
+
**Kind**: instance method of [<code>Stackable</code>](#Stackable)
|
|
175
|
+
**Overrides**: [<code>run</code>](#Runnable+run)
|
|
176
|
+
<a name="Stackable.make"></a>
|
|
177
|
+
|
|
178
|
+
### Stackable.make(stackable, [stackableClass]) ⇒ [<code>Stackable</code>](#Stackable)
|
|
179
|
+
Make a new Stackable from the data given if it is not already a valid Stackable.
|
|
180
|
+
|
|
181
|
+
**Kind**: static method of [<code>Stackable</code>](#Stackable)
|
|
182
|
+
**Methodof**: Stackable
|
|
183
|
+
|
|
184
|
+
| Param | Type | Default |
|
|
185
|
+
| --- | --- | --- |
|
|
186
|
+
| stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> | |
|
|
187
|
+
| [stackableClass] | [<code>Stackable</code>](#Stackable) | <code>Stackable</code> |
|
|
188
|
+
|
|
189
|
+
<a name="Stackable.fromArray"></a>
|
|
190
|
+
|
|
191
|
+
### Stackable.fromArray([values], [stackableClass]) ⇒ <code>Object</code>
|
|
192
|
+
Convert an array into Stackable instances, return the head and tail Stackables.
|
|
193
|
+
|
|
194
|
+
**Kind**: static method of [<code>Stackable</code>](#Stackable)
|
|
195
|
+
|
|
196
|
+
| Param | Type | Default |
|
|
197
|
+
| --- | --- | --- |
|
|
198
|
+
| [values] | <code>Array</code> | <code>[]</code> |
|
|
199
|
+
| [stackableClass] | [<code>Stackable</code>](#Stackable) | <code>Stackable</code> |
|
|
200
|
+
|
|
201
|
+
<a name="Stack"></a>
|
|
202
|
+
|
|
203
|
+
## Stack
|
|
204
|
+
Store a collection of items which can only be inserted and removed from the top.
|
|
205
|
+
|
|
206
|
+
**Kind**: global class
|
|
207
|
+
**See**: [Java Stack Interface](http://www.cs.williams.edu/~freund/cs136-073/javadoc/structure5/structure5/Stack.html)
|
|
208
|
+
|
|
209
|
+
* [Stack](#Stack)
|
|
210
|
+
* [new Stack(stackedList)](#new_Stack_new)
|
|
211
|
+
* _instance_
|
|
212
|
+
* [.stackedList](#Stack+stackedList) ⇒ <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList)
|
|
213
|
+
* [.add(stackable)](#Stack+add)
|
|
214
|
+
* [.empty()](#Stack+empty) ⇒ <code>boolean</code>
|
|
215
|
+
* [.get()](#Stack+get) ⇒ [<code>Stackable</code>](#Stackable)
|
|
216
|
+
* [.getFirst()](#Stack+getFirst) ⇒ [<code>Stackable</code>](#Stackable)
|
|
217
|
+
* [.peek()](#Stack+peek) ⇒ [<code>Stackable</code>](#Stackable)
|
|
218
|
+
* [.pop()](#Stack+pop) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
219
|
+
* [.push(stackable)](#Stack+push)
|
|
220
|
+
* [.remove()](#Stack+remove) ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
221
|
+
* [.size()](#Stack+size) ⇒ <code>number</code>
|
|
222
|
+
* _static_
|
|
223
|
+
* [.fromArray(values, stackableClass, listClass)](#Stack.fromArray) ⇒ [<code>Stack</code>](#Stack)
|
|
224
|
+
|
|
225
|
+
<a name="new_Stack_new"></a>
|
|
226
|
+
|
|
227
|
+
### new Stack(stackedList)
|
|
228
|
+
Instantiate the state with the starter stacked list.
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
| Param | Type |
|
|
232
|
+
| --- | --- |
|
|
233
|
+
| stackedList | <code>Iterable</code> \| [<code>Arrayable</code>](#Arrayable) |
|
|
234
|
+
|
|
235
|
+
<a name="Stack+stackedList"></a>
|
|
236
|
+
|
|
237
|
+
### stack.stackedList ⇒ <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList)
|
|
238
|
+
Return the internal stacked list.
|
|
239
|
+
|
|
240
|
+
**Kind**: instance property of [<code>Stack</code>](#Stack)
|
|
241
|
+
<a name="Stack+add"></a>
|
|
242
|
+
|
|
243
|
+
### stack.add(stackable)
|
|
244
|
+
Add a stackable task to the top of the stack.
|
|
245
|
+
|
|
246
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
247
|
+
|
|
248
|
+
| Param | Type |
|
|
249
|
+
| --- | --- |
|
|
250
|
+
| stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> |
|
|
251
|
+
|
|
252
|
+
<a name="Stack+empty"></a>
|
|
253
|
+
|
|
254
|
+
### stack.empty() ⇒ <code>boolean</code>
|
|
255
|
+
Return true if the stack is empty (there are no tasks in the stacked list)
|
|
256
|
+
|
|
257
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
258
|
+
<a name="Stack+get"></a>
|
|
259
|
+
|
|
260
|
+
### stack.get() ⇒ [<code>Stackable</code>](#Stackable)
|
|
261
|
+
Return a reference to the next stacked task.
|
|
262
|
+
|
|
263
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
264
|
+
<a name="Stack+getFirst"></a>
|
|
265
|
+
|
|
266
|
+
### stack.getFirst() ⇒ [<code>Stackable</code>](#Stackable)
|
|
267
|
+
Return a reference to the next stacked / first stacked task (alias for 'get()')
|
|
268
|
+
|
|
269
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
270
|
+
<a name="Stack+peek"></a>
|
|
271
|
+
|
|
272
|
+
### stack.peek() ⇒ [<code>Stackable</code>](#Stackable)
|
|
273
|
+
Take a look at the next stacked task (alias for 'get()')
|
|
274
|
+
|
|
275
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
276
|
+
<a name="Stack+pop"></a>
|
|
277
|
+
|
|
278
|
+
### stack.pop() ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
279
|
+
Remove the next stacked task and return it.
|
|
280
|
+
|
|
281
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
282
|
+
<a name="Stack+push"></a>
|
|
283
|
+
|
|
284
|
+
### stack.push(stackable)
|
|
285
|
+
Push a stackable task to the top of the stack.
|
|
286
|
+
|
|
287
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
288
|
+
|
|
289
|
+
| Param | Type |
|
|
290
|
+
| --- | --- |
|
|
291
|
+
| stackable | [<code>Stackable</code>](#Stackable) \| <code>\*</code> |
|
|
292
|
+
|
|
293
|
+
<a name="Stack+remove"></a>
|
|
294
|
+
|
|
295
|
+
### stack.remove() ⇒ [<code>Stackable</code>](#Stackable) \| <code>null</code>
|
|
296
|
+
Remove the next stacked task and return it.
|
|
297
|
+
|
|
298
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
299
|
+
<a name="Stack+size"></a>
|
|
300
|
+
|
|
301
|
+
### stack.size() ⇒ <code>number</code>
|
|
302
|
+
Get the size of the current stack.
|
|
303
|
+
|
|
304
|
+
**Kind**: instance method of [<code>Stack</code>](#Stack)
|
|
305
|
+
<a name="Stack.fromArray"></a>
|
|
306
|
+
|
|
307
|
+
### Stack.fromArray(values, stackableClass, listClass) ⇒ [<code>Stack</code>](#Stack)
|
|
308
|
+
Convert an array to a Stack.
|
|
309
|
+
|
|
310
|
+
**Kind**: static method of [<code>Stack</code>](#Stack)
|
|
311
|
+
**Methodof**: Stack
|
|
312
|
+
|
|
313
|
+
| Param | Type |
|
|
314
|
+
| --- | --- |
|
|
315
|
+
| values | <code>Array</code> |
|
|
316
|
+
| stackableClass | [<code>Stackable</code>](#Stackable) |
|
|
317
|
+
| listClass | [<code>Stack</code>](#Stack) \| <code>Iterable</code> |
|
|
318
|
+
|
|
319
|
+
<a name="Queueable"></a>
|
|
320
|
+
|
|
321
|
+
## Queueable ⇐ [<code>Linker</code>](#Linker)
|
|
322
|
+
Queueable represents a runnable entry in a queue.
|
|
323
|
+
|
|
324
|
+
**Kind**: global class
|
|
325
|
+
**Extends**: [<code>Linker</code>](#Linker), [<code>Runnable</code>](#Runnable)
|
|
326
|
+
|
|
327
|
+
* [Queueable](#Queueable) ⇐ [<code>Linker</code>](#Linker)
|
|
328
|
+
* [new Queueable([queueableData], [queueableClass])](#new_Queueable_new)
|
|
329
|
+
* _instance_
|
|
330
|
+
* [.complete](#Queueable+complete) ⇒ <code>boolean</code>
|
|
331
|
+
* [.isReady](#Queueable+isReady) ⇒ <code>boolean</code>
|
|
332
|
+
* [.running](#Queueable+running) ⇒ <code>boolean</code>
|
|
333
|
+
* [.task](#Queueable+task) ⇒ <code>\*</code>
|
|
334
|
+
* [.classType](#ArrayElement+classType) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
335
|
+
* [.markCompleted(completeResponse)](#Queueable+markCompleted) ⇒ [<code>completeResponse</code>](#completeResponse)
|
|
336
|
+
* [.run()](#Queueable+run) ⇒ [<code>completeResponse</code>](#completeResponse)
|
|
337
|
+
* _static_
|
|
338
|
+
* [.make(queueable, [queueableClass])](#Queueable.make) ⇒ [<code>Queueable</code>](#Queueable)
|
|
339
|
+
* [.fromArray(values, queueableClass)](#Queueable.fromArray) ⇒ <code>Object</code>
|
|
340
|
+
|
|
341
|
+
<a name="new_Queueable_new"></a>
|
|
342
|
+
|
|
343
|
+
### new Queueable([queueableData], [queueableClass])
|
|
344
|
+
Create a queueable item that can be used in a queue.
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
| Param | Type | Default |
|
|
348
|
+
| --- | --- | --- |
|
|
349
|
+
| [queueableData] | <code>Object</code> | <code>{}</code> |
|
|
350
|
+
| [queueableData.task] | <code>\*</code> | <code></code> |
|
|
351
|
+
| [queueableData.ready] | <code>boolean</code> \| <code>function</code> | <code>false</code> |
|
|
352
|
+
| [queueableClass] | [<code>Queueable</code>](#Queueable) | <code>Queueable</code> |
|
|
353
|
+
|
|
354
|
+
<a name="Queueable+complete"></a>
|
|
355
|
+
|
|
356
|
+
### queueable.complete ⇒ <code>boolean</code>
|
|
357
|
+
Check complete state.
|
|
358
|
+
|
|
359
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
360
|
+
<a name="Queueable+isReady"></a>
|
|
361
|
+
|
|
362
|
+
### queueable.isReady ⇒ <code>boolean</code>
|
|
363
|
+
Check ready state.
|
|
364
|
+
|
|
365
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
366
|
+
<a name="Queueable+running"></a>
|
|
367
|
+
|
|
368
|
+
### queueable.running ⇒ <code>boolean</code>
|
|
369
|
+
Check running state.
|
|
370
|
+
|
|
371
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
372
|
+
<a name="Queueable+task"></a>
|
|
373
|
+
|
|
374
|
+
### queueable.task ⇒ <code>\*</code>
|
|
375
|
+
Retrieve the data which should be formed as a task.
|
|
376
|
+
|
|
377
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
378
|
+
**Overrides**: [<code>task</code>](#Runnable+task)
|
|
379
|
+
<a name="ArrayElement+classType"></a>
|
|
380
|
+
|
|
381
|
+
### queueable.classType ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
382
|
+
Return the type of class used for Element.
|
|
383
|
+
|
|
384
|
+
**Kind**: instance property of [<code>Queueable</code>](#Queueable)
|
|
385
|
+
**Overrides**: [<code>classType</code>](#ArrayElement+classType)
|
|
386
|
+
<a name="Queueable+markCompleted"></a>
|
|
387
|
+
|
|
388
|
+
### queueable.markCompleted(completeResponse) ⇒ [<code>completeResponse</code>](#completeResponse)
|
|
389
|
+
Set this queueable as completed.
|
|
390
|
+
|
|
391
|
+
**Kind**: instance method of [<code>Queueable</code>](#Queueable)
|
|
392
|
+
|
|
393
|
+
| Param | Type | Default |
|
|
394
|
+
| --- | --- | --- |
|
|
395
|
+
| completeResponse | <code>Object</code> | |
|
|
396
|
+
| [completeResponse.success] | <code>\*</code> | <code>true</code> |
|
|
397
|
+
| [completeResponse.error] | <code>\*</code> | <code>false</code> |
|
|
398
|
+
| [completeResponse.context] | <code>\*</code> | <code></code> |
|
|
399
|
+
|
|
400
|
+
<a name="Queueable+run"></a>
|
|
401
|
+
|
|
402
|
+
### queueable.run() ⇒ [<code>completeResponse</code>](#completeResponse)
|
|
403
|
+
Intend to run the queued task when it is ready. If ready, mark this task as running and run the task.
|
|
404
|
+
|
|
405
|
+
**Kind**: instance method of [<code>Queueable</code>](#Queueable)
|
|
406
|
+
**Overrides**: [<code>run</code>](#Runnable+run)
|
|
407
|
+
<a name="Queueable.make"></a>
|
|
408
|
+
|
|
409
|
+
### Queueable.make(queueable, [queueableClass]) ⇒ [<code>Queueable</code>](#Queueable)
|
|
410
|
+
Make a new Queueable from the data given if it is not already a valid Queueable.
|
|
411
|
+
|
|
412
|
+
**Kind**: static method of [<code>Queueable</code>](#Queueable)
|
|
413
|
+
**Methodof**: Queueable
|
|
414
|
+
|
|
415
|
+
| Param | Type | Default |
|
|
416
|
+
| --- | --- | --- |
|
|
417
|
+
| queueable | [<code>Queueable</code>](#Queueable) \| <code>\*</code> | |
|
|
418
|
+
| [queueableClass] | [<code>Queueable</code>](#Queueable) | <code>Queueable</code> |
|
|
419
|
+
|
|
420
|
+
<a name="Queueable.fromArray"></a>
|
|
421
|
+
|
|
422
|
+
### Queueable.fromArray(values, queueableClass) ⇒ <code>Object</code>
|
|
423
|
+
Convert an array into Queueable instances, return the head and tail Queueables.
|
|
424
|
+
|
|
425
|
+
**Kind**: static method of [<code>Queueable</code>](#Queueable)
|
|
426
|
+
|
|
427
|
+
| Param | Type |
|
|
428
|
+
| --- | --- |
|
|
429
|
+
| values | <code>Array</code> |
|
|
430
|
+
| queueableClass | [<code>Queueable</code>](#Queueable) |
|
|
431
|
+
|
|
432
|
+
<a name="Queue"></a>
|
|
433
|
+
|
|
434
|
+
## Queue
|
|
435
|
+
Maintain a series of queued items.
|
|
436
|
+
|
|
437
|
+
**Kind**: global class
|
|
438
|
+
**See**: [Java Queue Interface](http://www.cs.williams.edu/~freund/cs136-073/javadoc/structure5/structure5/Queue.html)
|
|
439
|
+
|
|
440
|
+
* [Queue](#Queue)
|
|
441
|
+
* [new Queue(queuedList)](#new_Queue_new)
|
|
442
|
+
* _instance_
|
|
443
|
+
* [.queuedList](#Queue+queuedList) ⇒ <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList)
|
|
444
|
+
* [.add(queueable)](#Queue+add)
|
|
445
|
+
* [.dequeue()](#Queue+dequeue) ⇒ [<code>completeResponse</code>](#completeResponse) \| <code>\*</code>
|
|
446
|
+
* [.empty()](#Queue+empty) ⇒ <code>boolean</code>
|
|
447
|
+
* [.enqueue(queueable)](#Queue+enqueue)
|
|
448
|
+
* [.get()](#Queue+get) ⇒ [<code>Queueable</code>](#Queueable)
|
|
449
|
+
* [.getFirst()](#Queue+getFirst) ⇒ [<code>Queueable</code>](#Queueable)
|
|
450
|
+
* [.peek()](#Queue+peek) ⇒ [<code>Queueable</code>](#Queueable)
|
|
451
|
+
* [.remove()](#Queue+remove) ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
|
|
452
|
+
* [.size()](#Queue+size) ⇒ <code>number</code>
|
|
453
|
+
* _static_
|
|
454
|
+
* [.fromArray(values, queueableClass, listClass)](#Queue.fromArray) ⇒ [<code>Queue</code>](#Queue)
|
|
455
|
+
|
|
456
|
+
<a name="new_Queue_new"></a>
|
|
457
|
+
|
|
458
|
+
### new Queue(queuedList)
|
|
459
|
+
Instantiate the queue with the given queue list.
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
| Param | Type |
|
|
463
|
+
| --- | --- |
|
|
464
|
+
| queuedList | <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList) |
|
|
465
|
+
|
|
466
|
+
<a name="Queue+queuedList"></a>
|
|
467
|
+
|
|
468
|
+
### queue.queuedList ⇒ <code>Iterable</code> \| [<code>LinkedList</code>](#LinkedList)
|
|
469
|
+
Return the internal queued list.
|
|
470
|
+
|
|
471
|
+
**Kind**: instance property of [<code>Queue</code>](#Queue)
|
|
472
|
+
<a name="Queue+add"></a>
|
|
473
|
+
|
|
474
|
+
### queue.add(queueable)
|
|
475
|
+
Add a queued task to the end of the queue
|
|
476
|
+
|
|
477
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
478
|
+
|
|
479
|
+
| Param | Type |
|
|
480
|
+
| --- | --- |
|
|
481
|
+
| queueable | [<code>Queueable</code>](#Queueable) \| <code>\*</code> |
|
|
482
|
+
|
|
483
|
+
<a name="Queue+dequeue"></a>
|
|
484
|
+
|
|
485
|
+
### queue.dequeue() ⇒ [<code>completeResponse</code>](#completeResponse) \| <code>\*</code>
|
|
486
|
+
Take a queued task from the front of the queue and run it if ready.
|
|
487
|
+
|
|
488
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
489
|
+
<a name="Queue+empty"></a>
|
|
490
|
+
|
|
491
|
+
### queue.empty() ⇒ <code>boolean</code>
|
|
492
|
+
Return true if the queue is empty (there are no tasks in the queue list)
|
|
493
|
+
|
|
494
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
495
|
+
<a name="Queue+enqueue"></a>
|
|
496
|
+
|
|
497
|
+
### queue.enqueue(queueable)
|
|
498
|
+
Add a queued task to the end of the queue (alias for 'add()')
|
|
499
|
+
|
|
500
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
501
|
+
|
|
502
|
+
| Param | Type |
|
|
503
|
+
| --- | --- |
|
|
504
|
+
| queueable | [<code>Queueable</code>](#Queueable) |
|
|
505
|
+
|
|
506
|
+
<a name="Queue+get"></a>
|
|
507
|
+
|
|
508
|
+
### queue.get() ⇒ [<code>Queueable</code>](#Queueable)
|
|
509
|
+
Return a reference to the next queued task.
|
|
510
|
+
|
|
511
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
512
|
+
<a name="Queue+getFirst"></a>
|
|
513
|
+
|
|
514
|
+
### queue.getFirst() ⇒ [<code>Queueable</code>](#Queueable)
|
|
515
|
+
Return a reference to the next queued / first queued task (alias for 'get()')
|
|
516
|
+
|
|
517
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
518
|
+
<a name="Queue+peek"></a>
|
|
519
|
+
|
|
520
|
+
### queue.peek() ⇒ [<code>Queueable</code>](#Queueable)
|
|
521
|
+
Take a look at the next queued task (alias for 'get()')
|
|
522
|
+
|
|
523
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
524
|
+
<a name="Queue+remove"></a>
|
|
525
|
+
|
|
526
|
+
### queue.remove() ⇒ [<code>Queueable</code>](#Queueable) \| <code>null</code>
|
|
527
|
+
Remove the next queued item and return it.
|
|
528
|
+
|
|
529
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
530
|
+
<a name="Queue+size"></a>
|
|
531
|
+
|
|
532
|
+
### queue.size() ⇒ <code>number</code>
|
|
533
|
+
Get the length of the current queue.
|
|
534
|
+
|
|
535
|
+
**Kind**: instance method of [<code>Queue</code>](#Queue)
|
|
536
|
+
<a name="Queue.fromArray"></a>
|
|
537
|
+
|
|
538
|
+
### Queue.fromArray(values, queueableClass, listClass) ⇒ [<code>Queue</code>](#Queue)
|
|
539
|
+
Convert an array to a Queue.
|
|
540
|
+
|
|
541
|
+
**Kind**: static method of [<code>Queue</code>](#Queue)
|
|
542
|
+
**Methodof**: Queue
|
|
543
|
+
|
|
544
|
+
| Param | Type |
|
|
545
|
+
| --- | --- |
|
|
546
|
+
| values | <code>Array</code> |
|
|
547
|
+
| queueableClass | [<code>Queueable</code>](#Queueable) |
|
|
548
|
+
| listClass | [<code>Queue</code>](#Queue) \| <code>Iterable</code> |
|
|
549
|
+
|
|
550
|
+
<a name="TreeLinker"></a>
|
|
551
|
+
|
|
552
|
+
## TreeLinker ⇐ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
553
|
+
TreeLinker represents a node in a LinkedTreeList.
|
|
554
|
+
|
|
555
|
+
**Kind**: global class
|
|
556
|
+
**Extends**: [<code>DoubleLinker</code>](#DoubleLinker)
|
|
557
|
+
|
|
558
|
+
* [TreeLinker](#TreeLinker) ⇐ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
559
|
+
* [new TreeLinker([settings], [linkerClass])](#new_TreeLinker_new)
|
|
560
|
+
* _instance_
|
|
561
|
+
* [.parent](#TreeLinker+parent) ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
|
|
562
|
+
* [.children](#TreeLinker+children) ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
563
|
+
* [.classType](#ArrayElement+classType) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
564
|
+
* [.childrenFromArray(children, linkerClass)](#TreeLinker+childrenFromArray) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
565
|
+
* _static_
|
|
566
|
+
* [.make(linker, [linkerClass])](#TreeLinker.make) ⇒ [<code>Linker</code>](#Linker)
|
|
567
|
+
* [.fromArray([values], [linkerClass])](#TreeLinker.fromArray) ⇒ <code>Object</code>
|
|
568
|
+
|
|
569
|
+
<a name="new_TreeLinker_new"></a>
|
|
570
|
+
|
|
571
|
+
### new TreeLinker([settings], [linkerClass])
|
|
572
|
+
Create the new TreeLinker instance, provide the data and optionally configure the type of Linker.
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
| Param | Type | Default |
|
|
576
|
+
| --- | --- | --- |
|
|
577
|
+
| [settings] | <code>Object</code> | <code>{}</code> |
|
|
578
|
+
| [settings.data] | <code>\*</code> | <code></code> |
|
|
579
|
+
| [settings.prev] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> |
|
|
580
|
+
| [settings.next] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> |
|
|
581
|
+
| [settings.children] | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code></code> |
|
|
582
|
+
| [settings.parent] | [<code>TreeLinker</code>](#TreeLinker) | <code></code> |
|
|
583
|
+
| [linkerClass] | [<code>TreeLinker</code>](#TreeLinker) | <code>TreeLinker</code> |
|
|
584
|
+
|
|
585
|
+
<a name="TreeLinker+parent"></a>
|
|
586
|
+
|
|
587
|
+
### treeLinker.parent ⇒ [<code>TreeLinker</code>](#TreeLinker) \| <code>null</code>
|
|
588
|
+
Return the parent of this Tree Linker.
|
|
589
|
+
|
|
590
|
+
**Kind**: instance property of [<code>TreeLinker</code>](#TreeLinker)
|
|
591
|
+
<a name="TreeLinker+children"></a>
|
|
592
|
+
|
|
593
|
+
### treeLinker.children ⇒ [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>null</code>
|
|
594
|
+
Return the children of this Tree Linker.
|
|
595
|
+
|
|
596
|
+
**Kind**: instance property of [<code>TreeLinker</code>](#TreeLinker)
|
|
597
|
+
<a name="ArrayElement+classType"></a>
|
|
598
|
+
|
|
599
|
+
### treeLinker.classType ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
600
|
+
Return the type of class used for Element.
|
|
601
|
+
|
|
602
|
+
**Kind**: instance property of [<code>TreeLinker</code>](#TreeLinker)
|
|
603
|
+
**Overrides**: [<code>classType</code>](#ArrayElement+classType)
|
|
604
|
+
<a name="TreeLinker+childrenFromArray"></a>
|
|
605
|
+
|
|
606
|
+
### treeLinker.childrenFromArray(children, linkerClass) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
607
|
+
Create the children for this tree from an array.
|
|
608
|
+
|
|
609
|
+
**Kind**: instance method of [<code>TreeLinker</code>](#TreeLinker)
|
|
610
|
+
|
|
611
|
+
| Param | Type | Default |
|
|
612
|
+
| --- | --- | --- |
|
|
613
|
+
| children | <code>Array</code> \| <code>null</code> | <code></code> |
|
|
614
|
+
| linkerClass | [<code>TreeLinker</code>](#TreeLinker) | |
|
|
615
|
+
|
|
616
|
+
<a name="TreeLinker.make"></a>
|
|
617
|
+
|
|
618
|
+
### TreeLinker.make(linker, [linkerClass]) ⇒ [<code>Linker</code>](#Linker)
|
|
619
|
+
Make a new DoubleLinker from the data given if it is not already a valid Linker.
|
|
620
|
+
|
|
621
|
+
**Kind**: static method of [<code>TreeLinker</code>](#TreeLinker)
|
|
622
|
+
**Methodof**: TreeLinker
|
|
623
|
+
|
|
624
|
+
| Param | Type | Default |
|
|
625
|
+
| --- | --- | --- |
|
|
626
|
+
| linker | [<code>TreeLinker</code>](#TreeLinker) \| <code>\*</code> | |
|
|
627
|
+
| [linkerClass] | [<code>TreeLinker</code>](#TreeLinker) | <code>TreeLinker</code> |
|
|
628
|
+
|
|
629
|
+
<a name="TreeLinker.fromArray"></a>
|
|
630
|
+
|
|
631
|
+
### TreeLinker.fromArray([values], [linkerClass]) ⇒ <code>Object</code>
|
|
632
|
+
Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
|
|
633
|
+
|
|
634
|
+
**Kind**: static method of [<code>TreeLinker</code>](#TreeLinker)
|
|
635
|
+
**Methodof**: TreeLinker
|
|
636
|
+
|
|
637
|
+
| Param | Type | Default |
|
|
638
|
+
| --- | --- | --- |
|
|
639
|
+
| [values] | <code>Array</code> | <code>[]</code> |
|
|
640
|
+
| [linkerClass] | [<code>TreeLinker</code>](#TreeLinker) | <code>TreeLinker</code> |
|
|
641
|
+
|
|
642
|
+
<a name="LinkedTreeList"></a>
|
|
643
|
+
|
|
644
|
+
## LinkedTreeList ⇐ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
645
|
+
LinkedTreeList represents a collection stored with a root and spreading in branching (tree) formation..
|
|
646
|
+
|
|
647
|
+
**Kind**: global class
|
|
648
|
+
**Extends**: [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
649
|
+
|
|
650
|
+
* [LinkedTreeList](#LinkedTreeList) ⇐ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
651
|
+
* [new LinkedTreeList([listClass])](#new_LinkedTreeList_new)
|
|
652
|
+
* _instance_
|
|
653
|
+
* [.parent](#LinkedTreeList+parent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
654
|
+
* [.parent](#LinkedTreeList+parent)
|
|
655
|
+
* [.rootParent](#LinkedTreeList+rootParent) ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
656
|
+
* [.first](#DoublyLinkedList+first) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
657
|
+
* [.last](#DoublyLinkedList+last) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
658
|
+
* [.length](#DoublyLinkedList+length) ⇒ <code>number</code>
|
|
659
|
+
* [.classType](#Arrayable+classType) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
660
|
+
* [.initialized](#Arrayable+initialized) ⇒ <code>boolean</code>
|
|
661
|
+
* [.innerList](#Arrayable+innerList) ⇒ <code>Array</code>
|
|
662
|
+
* [.setChildren(item, children)](#LinkedTreeList+setChildren)
|
|
663
|
+
* [.insertAfter(node, newNode)](#DoublyLinkedList+insertAfter) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
664
|
+
* [.insertBefore(node, newNode)](#DoublyLinkedList+insertBefore) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
665
|
+
* [.remove(node)](#DoublyLinkedList+remove) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
666
|
+
* [.reset()](#DoublyLinkedList+reset) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
667
|
+
* [.item(index)](#DoublyLinkedList+item) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
668
|
+
* [.forEach(callback, thisArg)](#DoublyLinkedList+forEach)
|
|
669
|
+
* [.initialize(initialList)](#LinkedList+initialize) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
670
|
+
* [.append(node, after)](#LinkedList+append) ⇒ [<code>Linker</code>](#Linker)
|
|
671
|
+
* [.prepend(node, before)](#LinkedList+prepend) ⇒ [<code>Linker</code>](#Linker)
|
|
672
|
+
* _static_
|
|
673
|
+
* [.fromArray([values], [linkerClass], [listClass])](#LinkedTreeList.fromArray) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
674
|
+
|
|
675
|
+
<a name="new_LinkedTreeList_new"></a>
|
|
676
|
+
|
|
677
|
+
### new LinkedTreeList([listClass])
|
|
678
|
+
Create the new LinkedTreeList instance, configure the list class.
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
| Param | Type | Default |
|
|
682
|
+
| --- | --- | --- |
|
|
683
|
+
| [listClass] | [<code>LinkedTreeList</code>](#LinkedTreeList) \| <code>Iterable</code> | <code>LinkedTreeList</code> |
|
|
684
|
+
|
|
685
|
+
<a name="LinkedTreeList+parent"></a>
|
|
686
|
+
|
|
687
|
+
### linkedTreeList.parent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
688
|
+
Get the parent of this tree list.
|
|
689
|
+
|
|
690
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
691
|
+
<a name="LinkedTreeList+parent"></a>
|
|
692
|
+
|
|
693
|
+
### linkedTreeList.parent
|
|
694
|
+
Set the parent of this tree list
|
|
695
|
+
|
|
696
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
697
|
+
|
|
698
|
+
| Param | Type |
|
|
699
|
+
| --- | --- |
|
|
700
|
+
| parent | [<code>TreeLinker</code>](#TreeLinker) |
|
|
701
|
+
|
|
702
|
+
<a name="LinkedTreeList+rootParent"></a>
|
|
703
|
+
|
|
704
|
+
### linkedTreeList.rootParent ⇒ [<code>TreeLinker</code>](#TreeLinker)
|
|
705
|
+
Return the root parent of the entire tree.
|
|
706
|
+
|
|
707
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
708
|
+
<a name="DoublyLinkedList+first"></a>
|
|
709
|
+
|
|
710
|
+
### linkedTreeList.first ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
711
|
+
Retrieve the first DoubleLinker in the list.
|
|
712
|
+
|
|
713
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
714
|
+
**Overrides**: [<code>first</code>](#DoublyLinkedList+first)
|
|
715
|
+
<a name="DoublyLinkedList+last"></a>
|
|
716
|
+
|
|
717
|
+
### linkedTreeList.last ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
718
|
+
Retrieve the last DoubleLinker in the list.
|
|
719
|
+
|
|
720
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
721
|
+
**Overrides**: [<code>last</code>](#DoublyLinkedList+last)
|
|
722
|
+
<a name="DoublyLinkedList+length"></a>
|
|
723
|
+
|
|
724
|
+
### linkedTreeList.length ⇒ <code>number</code>
|
|
725
|
+
Return the length of the list.
|
|
726
|
+
|
|
727
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
728
|
+
**Overrides**: [<code>length</code>](#DoublyLinkedList+length)
|
|
729
|
+
<a name="Arrayable+classType"></a>
|
|
730
|
+
|
|
731
|
+
### linkedTreeList.classType ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
732
|
+
Return the type of class used for Arrayable.
|
|
733
|
+
|
|
734
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
735
|
+
**Overrides**: [<code>classType</code>](#Arrayable+classType)
|
|
736
|
+
<a name="Arrayable+initialized"></a>
|
|
737
|
+
|
|
738
|
+
### linkedTreeList.initialized ⇒ <code>boolean</code>
|
|
739
|
+
Detect if the inner list has been initialized.
|
|
740
|
+
|
|
741
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
742
|
+
**Overrides**: [<code>initialized</code>](#Arrayable+initialized)
|
|
743
|
+
<a name="Arrayable+innerList"></a>
|
|
744
|
+
|
|
745
|
+
### linkedTreeList.innerList ⇒ <code>Array</code>
|
|
746
|
+
Retrieve a copy of the innerList used.
|
|
747
|
+
|
|
748
|
+
**Kind**: instance property of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
749
|
+
**Overrides**: [<code>innerList</code>](#Arrayable+innerList)
|
|
750
|
+
<a name="LinkedTreeList+setChildren"></a>
|
|
751
|
+
|
|
752
|
+
### linkedTreeList.setChildren(item, children)
|
|
753
|
+
Set the children on a parent item.
|
|
754
|
+
|
|
755
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
756
|
+
|
|
757
|
+
| Param | Type | Default |
|
|
758
|
+
| --- | --- | --- |
|
|
759
|
+
| item | [<code>TreeLinker</code>](#TreeLinker) | |
|
|
760
|
+
| children | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code></code> |
|
|
761
|
+
|
|
762
|
+
<a name="DoublyLinkedList+insertAfter"></a>
|
|
763
|
+
|
|
764
|
+
### linkedTreeList.insertAfter(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
765
|
+
Insert a new node (or data) after a node.
|
|
766
|
+
|
|
767
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
768
|
+
**Overrides**: [<code>insertAfter</code>](#DoublyLinkedList+insertAfter)
|
|
769
|
+
|
|
770
|
+
| Param | Type |
|
|
771
|
+
| --- | --- |
|
|
772
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> |
|
|
773
|
+
| newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> |
|
|
774
|
+
|
|
775
|
+
<a name="DoublyLinkedList+insertBefore"></a>
|
|
776
|
+
|
|
777
|
+
### linkedTreeList.insertBefore(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
778
|
+
Insert a new node (or data) before a node.
|
|
779
|
+
|
|
780
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
781
|
+
**Overrides**: [<code>insertBefore</code>](#DoublyLinkedList+insertBefore)
|
|
782
|
+
|
|
783
|
+
| Param | Type |
|
|
784
|
+
| --- | --- |
|
|
785
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> |
|
|
786
|
+
| newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> |
|
|
787
|
+
|
|
788
|
+
<a name="DoublyLinkedList+remove"></a>
|
|
789
|
+
|
|
790
|
+
### linkedTreeList.remove(node) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
791
|
+
Remove a linker from this linked list.
|
|
792
|
+
|
|
793
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
794
|
+
**Overrides**: [<code>remove</code>](#DoublyLinkedList+remove)
|
|
795
|
+
|
|
796
|
+
| Param | Type |
|
|
797
|
+
| --- | --- |
|
|
798
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) |
|
|
799
|
+
|
|
800
|
+
<a name="DoublyLinkedList+reset"></a>
|
|
801
|
+
|
|
802
|
+
### linkedTreeList.reset() ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
803
|
+
Refresh all references and return head reference.
|
|
804
|
+
|
|
805
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
806
|
+
**Overrides**: [<code>reset</code>](#DoublyLinkedList+reset)
|
|
807
|
+
<a name="DoublyLinkedList+item"></a>
|
|
808
|
+
|
|
809
|
+
### linkedTreeList.item(index) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
810
|
+
Retrieve a DoubleLinker item from this list by numeric index, otherwise return null.
|
|
811
|
+
|
|
812
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
813
|
+
**Overrides**: [<code>item</code>](#DoublyLinkedList+item)
|
|
814
|
+
|
|
815
|
+
| Param | Type |
|
|
816
|
+
| --- | --- |
|
|
817
|
+
| index | <code>number</code> |
|
|
818
|
+
|
|
819
|
+
<a name="DoublyLinkedList+forEach"></a>
|
|
820
|
+
|
|
821
|
+
### linkedTreeList.forEach(callback, thisArg)
|
|
822
|
+
Be able to run forEach on this DoublyLinkedList ot iterate over the DoubleLinker Items.
|
|
823
|
+
|
|
824
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
825
|
+
**Overrides**: [<code>forEach</code>](#DoublyLinkedList+forEach)
|
|
826
|
+
|
|
827
|
+
| Param | Type |
|
|
828
|
+
| --- | --- |
|
|
829
|
+
| callback | [<code>forEachCallback</code>](#forEachCallback) |
|
|
830
|
+
| thisArg | [<code>DoublyLinkedList</code>](#DoublyLinkedList) |
|
|
831
|
+
|
|
832
|
+
<a name="LinkedList+initialize"></a>
|
|
833
|
+
|
|
834
|
+
### linkedTreeList.initialize(initialList) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
835
|
+
Initialize the inner list, should only run once.
|
|
836
|
+
|
|
837
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
838
|
+
**Overrides**: [<code>initialize</code>](#LinkedList+initialize)
|
|
839
|
+
|
|
840
|
+
| Param | Type |
|
|
841
|
+
| --- | --- |
|
|
842
|
+
| initialList | [<code>Linker</code>](#Linker) \| <code>Array</code> |
|
|
843
|
+
|
|
844
|
+
<a name="LinkedList+append"></a>
|
|
845
|
+
|
|
846
|
+
### linkedTreeList.append(node, after) ⇒ [<code>Linker</code>](#Linker)
|
|
847
|
+
Add a node (or data) after the given (or last) node in the list.
|
|
848
|
+
|
|
849
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
850
|
+
**Overrides**: [<code>append</code>](#LinkedList+append)
|
|
851
|
+
|
|
852
|
+
| Param | Type |
|
|
853
|
+
| --- | --- |
|
|
854
|
+
| node | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
855
|
+
| after | [<code>Linker</code>](#Linker) |
|
|
856
|
+
|
|
857
|
+
<a name="LinkedList+prepend"></a>
|
|
858
|
+
|
|
859
|
+
### linkedTreeList.prepend(node, before) ⇒ [<code>Linker</code>](#Linker)
|
|
860
|
+
Add a node (or data) before the given (or first) node in the list.
|
|
861
|
+
|
|
862
|
+
**Kind**: instance method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
863
|
+
**Overrides**: [<code>prepend</code>](#LinkedList+prepend)
|
|
864
|
+
|
|
865
|
+
| Param | Type |
|
|
866
|
+
| --- | --- |
|
|
867
|
+
| node | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
868
|
+
| before | [<code>Linker</code>](#Linker) |
|
|
869
|
+
|
|
870
|
+
<a name="LinkedTreeList.fromArray"></a>
|
|
871
|
+
|
|
872
|
+
### LinkedTreeList.fromArray([values], [linkerClass], [listClass]) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
873
|
+
Create an instance of LinkedTreeList from an array
|
|
874
|
+
|
|
875
|
+
**Kind**: static method of [<code>LinkedTreeList</code>](#LinkedTreeList)
|
|
876
|
+
|
|
877
|
+
| Param | Type | Default |
|
|
878
|
+
| --- | --- | --- |
|
|
879
|
+
| [values] | <code>Array</code> | <code>[]</code> |
|
|
880
|
+
| [linkerClass] | [<code>TreeLinker</code>](#TreeLinker) | <code>TreeLinker</code> |
|
|
881
|
+
| [listClass] | [<code>LinkedTreeList</code>](#LinkedTreeList) | <code>LinkedTreeList</code> |
|
|
882
|
+
|
|
883
|
+
<a name="Linker"></a>
|
|
884
|
+
|
|
885
|
+
## Linker ⇐ [<code>ArrayElement</code>](#ArrayElement)
|
|
886
|
+
Linker represents a node in a LinkedList.
|
|
887
|
+
|
|
888
|
+
**Kind**: global class
|
|
889
|
+
**Extends**: [<code>ArrayElement</code>](#ArrayElement)
|
|
890
|
+
|
|
891
|
+
* [Linker](#Linker) ⇐ [<code>ArrayElement</code>](#ArrayElement)
|
|
892
|
+
* [new Linker([nodeData], [linkerClass])](#new_Linker_new)
|
|
893
|
+
* _instance_
|
|
894
|
+
* [.classType](#ArrayElement+classType) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
895
|
+
* _static_
|
|
896
|
+
* [.make(linker, [linkerClass])](#Linker.make) ⇒ [<code>Linker</code>](#Linker)
|
|
897
|
+
* [.fromArray([values], [linkerClass])](#Linker.fromArray) ⇒ <code>Object</code>
|
|
898
|
+
|
|
899
|
+
<a name="new_Linker_new"></a>
|
|
900
|
+
|
|
901
|
+
### new Linker([nodeData], [linkerClass])
|
|
902
|
+
Create the new Linker instance, provide the data and optionally configure the type of Linker.
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
| Param | Type | Default |
|
|
906
|
+
| --- | --- | --- |
|
|
907
|
+
| [nodeData] | <code>Object</code> | <code>{}</code> |
|
|
908
|
+
| [nodeData.data] | <code>\*</code> | <code></code> |
|
|
909
|
+
| [nodeData.next] | [<code>Linker</code>](#Linker) \| <code>null</code> | <code></code> |
|
|
910
|
+
| [linkerClass] | [<code>Linker</code>](#Linker) | <code>Linker</code> |
|
|
911
|
+
|
|
912
|
+
<a name="ArrayElement+classType"></a>
|
|
913
|
+
|
|
914
|
+
### linker.classType ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
915
|
+
Return the type of class used for Element.
|
|
916
|
+
|
|
917
|
+
**Kind**: instance property of [<code>Linker</code>](#Linker)
|
|
918
|
+
**Overrides**: [<code>classType</code>](#ArrayElement+classType)
|
|
919
|
+
<a name="Linker.make"></a>
|
|
920
|
+
|
|
921
|
+
### Linker.make(linker, [linkerClass]) ⇒ [<code>Linker</code>](#Linker)
|
|
922
|
+
Make a new Linker from the data given if it is not already a valid Linker.
|
|
923
|
+
|
|
924
|
+
**Kind**: static method of [<code>Linker</code>](#Linker)
|
|
925
|
+
**Methodof**: Linker
|
|
926
|
+
|
|
927
|
+
| Param | Type | Default |
|
|
928
|
+
| --- | --- | --- |
|
|
929
|
+
| linker | [<code>Linker</code>](#Linker) \| <code>\*</code> | |
|
|
930
|
+
| [linkerClass] | [<code>Linker</code>](#Linker) | <code>Linker</code> |
|
|
931
|
+
|
|
932
|
+
<a name="Linker.fromArray"></a>
|
|
933
|
+
|
|
934
|
+
### Linker.fromArray([values], [linkerClass]) ⇒ <code>Object</code>
|
|
935
|
+
Convert an array into Linker instances, return the head and tail Linkers.
|
|
936
|
+
|
|
937
|
+
**Kind**: static method of [<code>Linker</code>](#Linker)
|
|
938
|
+
**Methodof**: Linker
|
|
939
|
+
|
|
940
|
+
| Param | Type | Default |
|
|
941
|
+
| --- | --- | --- |
|
|
942
|
+
| [values] | <code>Array</code> | <code>[]</code> |
|
|
943
|
+
| [linkerClass] | [<code>Linker</code>](#Linker) | <code>Linker</code> |
|
|
944
|
+
|
|
945
|
+
<a name="LinkedList"></a>
|
|
946
|
+
|
|
947
|
+
## LinkedList ⇐ [<code>Arrayable</code>](#Arrayable)
|
|
948
|
+
LinkedList represents a collection stored as a LinkedList with next references.
|
|
949
|
+
|
|
950
|
+
**Kind**: global class
|
|
951
|
+
**Extends**: [<code>Arrayable</code>](#Arrayable)
|
|
952
|
+
|
|
953
|
+
* [LinkedList](#LinkedList) ⇐ [<code>Arrayable</code>](#Arrayable)
|
|
954
|
+
* [new LinkedList(listClass)](#new_LinkedList_new)
|
|
955
|
+
* _instance_
|
|
956
|
+
* [.first](#LinkedList+first) ⇒ [<code>Linker</code>](#Linker)
|
|
957
|
+
* [.last](#LinkedList+last) ⇒ [<code>Linker</code>](#Linker)
|
|
958
|
+
* [.length](#LinkedList+length) ⇒ <code>number</code>
|
|
959
|
+
* [.classType](#Arrayable+classType) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
960
|
+
* [.initialized](#Arrayable+initialized) ⇒ <code>boolean</code>
|
|
961
|
+
* [.innerList](#Arrayable+innerList) ⇒ <code>Array</code>
|
|
962
|
+
* [.initialize(initialList)](#LinkedList+initialize) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
963
|
+
* [.insertAfter(node, newNode)](#LinkedList+insertAfter) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
964
|
+
* [.insertBefore(node, newNode)](#LinkedList+insertBefore) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
965
|
+
* [.append(node, after)](#LinkedList+append) ⇒ [<code>Linker</code>](#Linker)
|
|
966
|
+
* [.prepend(node, before)](#LinkedList+prepend) ⇒ [<code>Linker</code>](#Linker)
|
|
967
|
+
* [.remove(node)](#LinkedList+remove) ⇒ [<code>Linker</code>](#Linker)
|
|
968
|
+
* [.item(index)](#LinkedList+item) ⇒ [<code>Linker</code>](#Linker) \| <code>null</code>
|
|
969
|
+
* [.forEach(callback, thisArg)](#LinkedList+forEach) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
970
|
+
* _static_
|
|
971
|
+
* [.fromArray(values, linkerClass, listClass)](#LinkedList.fromArray) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
972
|
+
|
|
973
|
+
<a name="new_LinkedList_new"></a>
|
|
974
|
+
|
|
975
|
+
### new LinkedList(listClass)
|
|
976
|
+
Create the new LinkedList instance, configure the Linker and List classes.
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
| Param | Type |
|
|
980
|
+
| --- | --- |
|
|
981
|
+
| listClass | [<code>LinkedList</code>](#LinkedList) \| <code>Iterable</code> |
|
|
982
|
+
|
|
983
|
+
<a name="LinkedList+first"></a>
|
|
984
|
+
|
|
985
|
+
### linkedList.first ⇒ [<code>Linker</code>](#Linker)
|
|
986
|
+
Retrieve the first Linker in the list.
|
|
987
|
+
|
|
988
|
+
**Kind**: instance property of [<code>LinkedList</code>](#LinkedList)
|
|
989
|
+
**Overrides**: [<code>first</code>](#Arrayable+first)
|
|
990
|
+
<a name="LinkedList+last"></a>
|
|
991
|
+
|
|
992
|
+
### linkedList.last ⇒ [<code>Linker</code>](#Linker)
|
|
993
|
+
Retrieve the last Linker in the list.
|
|
994
|
+
|
|
995
|
+
**Kind**: instance property of [<code>LinkedList</code>](#LinkedList)
|
|
996
|
+
**Overrides**: [<code>last</code>](#Arrayable+last)
|
|
997
|
+
<a name="LinkedList+length"></a>
|
|
998
|
+
|
|
999
|
+
### linkedList.length ⇒ <code>number</code>
|
|
1000
|
+
Return the length of the list.
|
|
1001
|
+
|
|
1002
|
+
**Kind**: instance property of [<code>LinkedList</code>](#LinkedList)
|
|
1003
|
+
**Overrides**: [<code>length</code>](#Arrayable+length)
|
|
1004
|
+
<a name="Arrayable+classType"></a>
|
|
1005
|
+
|
|
1006
|
+
### linkedList.classType ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1007
|
+
Return the type of class used for Arrayable.
|
|
1008
|
+
|
|
1009
|
+
**Kind**: instance property of [<code>LinkedList</code>](#LinkedList)
|
|
1010
|
+
**Overrides**: [<code>classType</code>](#Arrayable+classType)
|
|
1011
|
+
<a name="Arrayable+initialized"></a>
|
|
1012
|
+
|
|
1013
|
+
### linkedList.initialized ⇒ <code>boolean</code>
|
|
1014
|
+
Detect if the inner list has been initialized.
|
|
1015
|
+
|
|
1016
|
+
**Kind**: instance property of [<code>LinkedList</code>](#LinkedList)
|
|
1017
|
+
**Overrides**: [<code>initialized</code>](#Arrayable+initialized)
|
|
1018
|
+
<a name="Arrayable+innerList"></a>
|
|
1019
|
+
|
|
1020
|
+
### linkedList.innerList ⇒ <code>Array</code>
|
|
1021
|
+
Retrieve a copy of the innerList used.
|
|
1022
|
+
|
|
1023
|
+
**Kind**: instance property of [<code>LinkedList</code>](#LinkedList)
|
|
1024
|
+
**Overrides**: [<code>innerList</code>](#Arrayable+innerList)
|
|
1025
|
+
<a name="LinkedList+initialize"></a>
|
|
1026
|
+
|
|
1027
|
+
### linkedList.initialize(initialList) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
1028
|
+
Initialize the inner list, should only run once.
|
|
1029
|
+
|
|
1030
|
+
**Kind**: instance method of [<code>LinkedList</code>](#LinkedList)
|
|
1031
|
+
**Overrides**: [<code>initialize</code>](#Arrayable+initialize)
|
|
1032
|
+
|
|
1033
|
+
| Param | Type |
|
|
1034
|
+
| --- | --- |
|
|
1035
|
+
| initialList | [<code>Linker</code>](#Linker) \| <code>Array</code> |
|
|
1036
|
+
|
|
1037
|
+
<a name="LinkedList+insertAfter"></a>
|
|
1038
|
+
|
|
1039
|
+
### linkedList.insertAfter(node, newNode) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
1040
|
+
Insert a new node (or data) after a node.
|
|
1041
|
+
|
|
1042
|
+
**Kind**: instance method of [<code>LinkedList</code>](#LinkedList)
|
|
1043
|
+
**Overrides**: [<code>insertAfter</code>](#Arrayable+insertAfter)
|
|
1044
|
+
|
|
1045
|
+
| Param | Type |
|
|
1046
|
+
| --- | --- |
|
|
1047
|
+
| node | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
1048
|
+
| newNode | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
1049
|
+
|
|
1050
|
+
<a name="LinkedList+insertBefore"></a>
|
|
1051
|
+
|
|
1052
|
+
### linkedList.insertBefore(node, newNode) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
1053
|
+
Insert a new node (or data) before a node.
|
|
1054
|
+
|
|
1055
|
+
**Kind**: instance method of [<code>LinkedList</code>](#LinkedList)
|
|
1056
|
+
**Overrides**: [<code>insertBefore</code>](#Arrayable+insertBefore)
|
|
1057
|
+
|
|
1058
|
+
| Param | Type |
|
|
1059
|
+
| --- | --- |
|
|
1060
|
+
| node | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
1061
|
+
| newNode | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
1062
|
+
|
|
1063
|
+
<a name="LinkedList+append"></a>
|
|
1064
|
+
|
|
1065
|
+
### linkedList.append(node, after) ⇒ [<code>Linker</code>](#Linker)
|
|
1066
|
+
Add a node (or data) after the given (or last) node in the list.
|
|
1067
|
+
|
|
1068
|
+
**Kind**: instance method of [<code>LinkedList</code>](#LinkedList)
|
|
1069
|
+
**Overrides**: [<code>append</code>](#Arrayable+append)
|
|
1070
|
+
|
|
1071
|
+
| Param | Type |
|
|
1072
|
+
| --- | --- |
|
|
1073
|
+
| node | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
1074
|
+
| after | [<code>Linker</code>](#Linker) |
|
|
1075
|
+
|
|
1076
|
+
<a name="LinkedList+prepend"></a>
|
|
1077
|
+
|
|
1078
|
+
### linkedList.prepend(node, before) ⇒ [<code>Linker</code>](#Linker)
|
|
1079
|
+
Add a node (or data) before the given (or first) node in the list.
|
|
1080
|
+
|
|
1081
|
+
**Kind**: instance method of [<code>LinkedList</code>](#LinkedList)
|
|
1082
|
+
**Overrides**: [<code>prepend</code>](#Arrayable+prepend)
|
|
1083
|
+
|
|
1084
|
+
| Param | Type |
|
|
1085
|
+
| --- | --- |
|
|
1086
|
+
| node | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
1087
|
+
| before | [<code>Linker</code>](#Linker) |
|
|
1088
|
+
|
|
1089
|
+
<a name="LinkedList+remove"></a>
|
|
1090
|
+
|
|
1091
|
+
### linkedList.remove(node) ⇒ [<code>Linker</code>](#Linker)
|
|
1092
|
+
Remove a linker from this linked list.
|
|
1093
|
+
|
|
1094
|
+
**Kind**: instance method of [<code>LinkedList</code>](#LinkedList)
|
|
1095
|
+
**Overrides**: [<code>remove</code>](#Arrayable+remove)
|
|
1096
|
+
|
|
1097
|
+
| Param | Type |
|
|
1098
|
+
| --- | --- |
|
|
1099
|
+
| node | [<code>Linker</code>](#Linker) |
|
|
1100
|
+
|
|
1101
|
+
<a name="LinkedList+item"></a>
|
|
1102
|
+
|
|
1103
|
+
### linkedList.item(index) ⇒ [<code>Linker</code>](#Linker) \| <code>null</code>
|
|
1104
|
+
Retrieve a Linker item from this list by numeric index, otherwise return null.
|
|
1105
|
+
|
|
1106
|
+
**Kind**: instance method of [<code>LinkedList</code>](#LinkedList)
|
|
1107
|
+
**Overrides**: [<code>item</code>](#Arrayable+item)
|
|
1108
|
+
|
|
1109
|
+
| Param | Type |
|
|
1110
|
+
| --- | --- |
|
|
1111
|
+
| index | <code>number</code> |
|
|
1112
|
+
|
|
1113
|
+
<a name="LinkedList+forEach"></a>
|
|
1114
|
+
|
|
1115
|
+
### linkedList.forEach(callback, thisArg) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
1116
|
+
Be able to run forEach on this LinkedList to iterate over the linkers.
|
|
1117
|
+
|
|
1118
|
+
**Kind**: instance method of [<code>LinkedList</code>](#LinkedList)
|
|
1119
|
+
**Overrides**: [<code>forEach</code>](#Arrayable+forEach)
|
|
1120
|
+
|
|
1121
|
+
| Param | Type |
|
|
1122
|
+
| --- | --- |
|
|
1123
|
+
| callback | [<code>forEachCallback</code>](#forEachCallback) |
|
|
1124
|
+
| thisArg | [<code>LinkedList</code>](#LinkedList) \| [<code>Arrayable</code>](#Arrayable) |
|
|
1125
|
+
|
|
1126
|
+
<a name="LinkedList.fromArray"></a>
|
|
1127
|
+
|
|
1128
|
+
### LinkedList.fromArray(values, linkerClass, listClass) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
1129
|
+
Convert an array to a LinkedList.
|
|
1130
|
+
|
|
1131
|
+
**Kind**: static method of [<code>LinkedList</code>](#LinkedList)
|
|
1132
|
+
**Methodof**: LinkedList
|
|
1133
|
+
|
|
1134
|
+
| Param | Type |
|
|
1135
|
+
| --- | --- |
|
|
1136
|
+
| values | <code>Array</code> |
|
|
1137
|
+
| linkerClass | [<code>Linker</code>](#Linker) |
|
|
1138
|
+
| listClass | [<code>LinkedList</code>](#LinkedList) \| <code>Iterable</code> |
|
|
1139
|
+
|
|
1140
|
+
<a name="DoublyLinkedList"></a>
|
|
1141
|
+
|
|
1142
|
+
## DoublyLinkedList ⇐ [<code>LinkedList</code>](#LinkedList)
|
|
1143
|
+
DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.
|
|
1144
|
+
|
|
1145
|
+
**Kind**: global class
|
|
1146
|
+
**Extends**: [<code>LinkedList</code>](#LinkedList)
|
|
1147
|
+
|
|
1148
|
+
* [DoublyLinkedList](#DoublyLinkedList) ⇐ [<code>LinkedList</code>](#LinkedList)
|
|
1149
|
+
* [new DoublyLinkedList([listClass])](#new_DoublyLinkedList_new)
|
|
1150
|
+
* _instance_
|
|
1151
|
+
* [.first](#DoublyLinkedList+first) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1152
|
+
* [.last](#DoublyLinkedList+last) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1153
|
+
* [.length](#DoublyLinkedList+length) ⇒ <code>number</code>
|
|
1154
|
+
* [.classType](#Arrayable+classType) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1155
|
+
* [.initialized](#Arrayable+initialized) ⇒ <code>boolean</code>
|
|
1156
|
+
* [.innerList](#Arrayable+innerList) ⇒ <code>Array</code>
|
|
1157
|
+
* [.insertAfter(node, newNode)](#DoublyLinkedList+insertAfter) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1158
|
+
* [.insertBefore(node, newNode)](#DoublyLinkedList+insertBefore) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1159
|
+
* [.remove(node)](#DoublyLinkedList+remove) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1160
|
+
* [.reset()](#DoublyLinkedList+reset) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1161
|
+
* [.item(index)](#DoublyLinkedList+item) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
1162
|
+
* [.forEach(callback, thisArg)](#DoublyLinkedList+forEach)
|
|
1163
|
+
* [.initialize(initialList)](#LinkedList+initialize) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
1164
|
+
* [.append(node, after)](#LinkedList+append) ⇒ [<code>Linker</code>](#Linker)
|
|
1165
|
+
* [.prepend(node, before)](#LinkedList+prepend) ⇒ [<code>Linker</code>](#Linker)
|
|
1166
|
+
* _static_
|
|
1167
|
+
* [.fromArray([values], [linkerClass], [listClass])](#DoublyLinkedList.fromArray) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1168
|
+
|
|
1169
|
+
<a name="new_DoublyLinkedList_new"></a>
|
|
1170
|
+
|
|
1171
|
+
### new DoublyLinkedList([listClass])
|
|
1172
|
+
Create the new DoublyLinkedList instance, configure the Linker and List classes.
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
| Param | Type | Default |
|
|
1176
|
+
| --- | --- | --- |
|
|
1177
|
+
| [listClass] | [<code>DoublyLinkedList</code>](#DoublyLinkedList) \| <code>Iterable</code> | <code>DoublyLinkedList</code> |
|
|
1178
|
+
|
|
1179
|
+
<a name="DoublyLinkedList+first"></a>
|
|
1180
|
+
|
|
1181
|
+
### doublyLinkedList.first ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1182
|
+
Retrieve the first DoubleLinker in the list.
|
|
1183
|
+
|
|
1184
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1185
|
+
**Overrides**: [<code>first</code>](#LinkedList+first)
|
|
1186
|
+
<a name="DoublyLinkedList+last"></a>
|
|
1187
|
+
|
|
1188
|
+
### doublyLinkedList.last ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1189
|
+
Retrieve the last DoubleLinker in the list.
|
|
1190
|
+
|
|
1191
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1192
|
+
**Overrides**: [<code>last</code>](#LinkedList+last)
|
|
1193
|
+
<a name="DoublyLinkedList+length"></a>
|
|
1194
|
+
|
|
1195
|
+
### doublyLinkedList.length ⇒ <code>number</code>
|
|
1196
|
+
Return the length of the list.
|
|
1197
|
+
|
|
1198
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1199
|
+
**Overrides**: [<code>length</code>](#LinkedList+length)
|
|
1200
|
+
<a name="Arrayable+classType"></a>
|
|
1201
|
+
|
|
1202
|
+
### doublyLinkedList.classType ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1203
|
+
Return the type of class used for Arrayable.
|
|
1204
|
+
|
|
1205
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1206
|
+
**Overrides**: [<code>classType</code>](#Arrayable+classType)
|
|
1207
|
+
<a name="Arrayable+initialized"></a>
|
|
1208
|
+
|
|
1209
|
+
### doublyLinkedList.initialized ⇒ <code>boolean</code>
|
|
1210
|
+
Detect if the inner list has been initialized.
|
|
1211
|
+
|
|
1212
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1213
|
+
**Overrides**: [<code>initialized</code>](#Arrayable+initialized)
|
|
1214
|
+
<a name="Arrayable+innerList"></a>
|
|
1215
|
+
|
|
1216
|
+
### doublyLinkedList.innerList ⇒ <code>Array</code>
|
|
1217
|
+
Retrieve a copy of the innerList used.
|
|
1218
|
+
|
|
1219
|
+
**Kind**: instance property of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1220
|
+
**Overrides**: [<code>innerList</code>](#Arrayable+innerList)
|
|
1221
|
+
<a name="DoublyLinkedList+insertAfter"></a>
|
|
1222
|
+
|
|
1223
|
+
### doublyLinkedList.insertAfter(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1224
|
+
Insert a new node (or data) after a node.
|
|
1225
|
+
|
|
1226
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1227
|
+
**Overrides**: [<code>insertAfter</code>](#LinkedList+insertAfter)
|
|
1228
|
+
|
|
1229
|
+
| Param | Type |
|
|
1230
|
+
| --- | --- |
|
|
1231
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> |
|
|
1232
|
+
| newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> |
|
|
1233
|
+
|
|
1234
|
+
<a name="DoublyLinkedList+insertBefore"></a>
|
|
1235
|
+
|
|
1236
|
+
### doublyLinkedList.insertBefore(node, newNode) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1237
|
+
Insert a new node (or data) before a node.
|
|
1238
|
+
|
|
1239
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1240
|
+
**Overrides**: [<code>insertBefore</code>](#LinkedList+insertBefore)
|
|
1241
|
+
|
|
1242
|
+
| Param | Type |
|
|
1243
|
+
| --- | --- |
|
|
1244
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> |
|
|
1245
|
+
| newNode | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> |
|
|
1246
|
+
|
|
1247
|
+
<a name="DoublyLinkedList+remove"></a>
|
|
1248
|
+
|
|
1249
|
+
### doublyLinkedList.remove(node) ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1250
|
+
Remove a linker from this linked list.
|
|
1251
|
+
|
|
1252
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1253
|
+
**Overrides**: [<code>remove</code>](#LinkedList+remove)
|
|
1254
|
+
|
|
1255
|
+
| Param | Type |
|
|
1256
|
+
| --- | --- |
|
|
1257
|
+
| node | [<code>DoubleLinker</code>](#DoubleLinker) |
|
|
1258
|
+
|
|
1259
|
+
<a name="DoublyLinkedList+reset"></a>
|
|
1260
|
+
|
|
1261
|
+
### doublyLinkedList.reset() ⇒ [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1262
|
+
Refresh all references and return head reference.
|
|
1263
|
+
|
|
1264
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1265
|
+
<a name="DoublyLinkedList+item"></a>
|
|
1266
|
+
|
|
1267
|
+
### doublyLinkedList.item(index) ⇒ [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code>
|
|
1268
|
+
Retrieve a DoubleLinker item from this list by numeric index, otherwise return null.
|
|
1269
|
+
|
|
1270
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1271
|
+
**Overrides**: [<code>item</code>](#LinkedList+item)
|
|
1272
|
+
|
|
1273
|
+
| Param | Type |
|
|
1274
|
+
| --- | --- |
|
|
1275
|
+
| index | <code>number</code> |
|
|
1276
|
+
|
|
1277
|
+
<a name="DoublyLinkedList+forEach"></a>
|
|
1278
|
+
|
|
1279
|
+
### doublyLinkedList.forEach(callback, thisArg)
|
|
1280
|
+
Be able to run forEach on this DoublyLinkedList ot iterate over the DoubleLinker Items.
|
|
1281
|
+
|
|
1282
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1283
|
+
**Overrides**: [<code>forEach</code>](#LinkedList+forEach)
|
|
1284
|
+
|
|
1285
|
+
| Param | Type |
|
|
1286
|
+
| --- | --- |
|
|
1287
|
+
| callback | [<code>forEachCallback</code>](#forEachCallback) |
|
|
1288
|
+
| thisArg | [<code>DoublyLinkedList</code>](#DoublyLinkedList) |
|
|
1289
|
+
|
|
1290
|
+
<a name="LinkedList+initialize"></a>
|
|
1291
|
+
|
|
1292
|
+
### doublyLinkedList.initialize(initialList) ⇒ [<code>LinkedList</code>](#LinkedList)
|
|
1293
|
+
Initialize the inner list, should only run once.
|
|
1294
|
+
|
|
1295
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1296
|
+
**Overrides**: [<code>initialize</code>](#LinkedList+initialize)
|
|
1297
|
+
|
|
1298
|
+
| Param | Type |
|
|
1299
|
+
| --- | --- |
|
|
1300
|
+
| initialList | [<code>Linker</code>](#Linker) \| <code>Array</code> |
|
|
1301
|
+
|
|
1302
|
+
<a name="LinkedList+append"></a>
|
|
1303
|
+
|
|
1304
|
+
### doublyLinkedList.append(node, after) ⇒ [<code>Linker</code>](#Linker)
|
|
1305
|
+
Add a node (or data) after the given (or last) node in the list.
|
|
1306
|
+
|
|
1307
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1308
|
+
**Overrides**: [<code>append</code>](#LinkedList+append)
|
|
1309
|
+
|
|
1310
|
+
| Param | Type |
|
|
1311
|
+
| --- | --- |
|
|
1312
|
+
| node | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
1313
|
+
| after | [<code>Linker</code>](#Linker) |
|
|
1314
|
+
|
|
1315
|
+
<a name="LinkedList+prepend"></a>
|
|
1316
|
+
|
|
1317
|
+
### doublyLinkedList.prepend(node, before) ⇒ [<code>Linker</code>](#Linker)
|
|
1318
|
+
Add a node (or data) before the given (or first) node in the list.
|
|
1319
|
+
|
|
1320
|
+
**Kind**: instance method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1321
|
+
**Overrides**: [<code>prepend</code>](#LinkedList+prepend)
|
|
1322
|
+
|
|
1323
|
+
| Param | Type |
|
|
1324
|
+
| --- | --- |
|
|
1325
|
+
| node | [<code>Linker</code>](#Linker) \| <code>\*</code> |
|
|
1326
|
+
| before | [<code>Linker</code>](#Linker) |
|
|
1327
|
+
|
|
1328
|
+
<a name="DoublyLinkedList.fromArray"></a>
|
|
1329
|
+
|
|
1330
|
+
### DoublyLinkedList.fromArray([values], [linkerClass], [listClass]) ⇒ [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1331
|
+
Convert an array into a DoublyLinkedList instance, return the new instance.
|
|
1332
|
+
|
|
1333
|
+
**Kind**: static method of [<code>DoublyLinkedList</code>](#DoublyLinkedList)
|
|
1334
|
+
**Methodof**: DoublyLinkedList
|
|
1335
|
+
|
|
1336
|
+
| Param | Type | Default |
|
|
1337
|
+
| --- | --- | --- |
|
|
1338
|
+
| [values] | <code>Array</code> | <code>[]</code> |
|
|
1339
|
+
| [linkerClass] | [<code>DoubleLinker</code>](#DoubleLinker) | <code>DoubleLinker</code> |
|
|
1340
|
+
| [listClass] | [<code>DoublyLinkedList</code>](#DoublyLinkedList) | <code>DoublyLinkedList</code> |
|
|
1341
|
+
|
|
1342
|
+
<a name="DoubleLinker"></a>
|
|
1343
|
+
|
|
1344
|
+
## DoubleLinker ⇐ [<code>Linker</code>](#Linker)
|
|
1345
|
+
DoubleLinker represents a node in a DoublyLinkedList.
|
|
1346
|
+
|
|
1347
|
+
**Kind**: global class
|
|
1348
|
+
**Extends**: [<code>Linker</code>](#Linker)
|
|
1349
|
+
|
|
1350
|
+
* [DoubleLinker](#DoubleLinker) ⇐ [<code>Linker</code>](#Linker)
|
|
1351
|
+
* [new DoubleLinker([nodeData], [linkerClass])](#new_DoubleLinker_new)
|
|
1352
|
+
* _instance_
|
|
1353
|
+
* [.classType](#ArrayElement+classType) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1354
|
+
* _static_
|
|
1355
|
+
* [.make(linker, [linkerClass])](#DoubleLinker.make) ⇒ [<code>Linker</code>](#Linker)
|
|
1356
|
+
* [.fromArray([values], [linkerClass])](#DoubleLinker.fromArray) ⇒ <code>Object</code>
|
|
1357
|
+
|
|
1358
|
+
<a name="new_DoubleLinker_new"></a>
|
|
1359
|
+
|
|
1360
|
+
### new DoubleLinker([nodeData], [linkerClass])
|
|
1361
|
+
Create the new DoubleLinker instance, provide the data and optionally configure the type of Linker.
|
|
1362
|
+
|
|
1363
|
+
|
|
1364
|
+
| Param | Type | Default |
|
|
1365
|
+
| --- | --- | --- |
|
|
1366
|
+
| [nodeData] | <code>Object</code> | <code>{}</code> |
|
|
1367
|
+
| [nodeData.data] | <code>\*</code> | <code></code> |
|
|
1368
|
+
| [nodeData.prev] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> |
|
|
1369
|
+
| [nodeData.next] | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>null</code> | <code></code> |
|
|
1370
|
+
| [linkerClass] | [<code>DoubleLinker</code>](#DoubleLinker) | <code>DoubleLinker</code> |
|
|
1371
|
+
|
|
1372
|
+
<a name="ArrayElement+classType"></a>
|
|
1373
|
+
|
|
1374
|
+
### doubleLinker.classType ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1375
|
+
Return the type of class used for Element.
|
|
1376
|
+
|
|
1377
|
+
**Kind**: instance property of [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1378
|
+
**Overrides**: [<code>classType</code>](#ArrayElement+classType)
|
|
1379
|
+
<a name="DoubleLinker.make"></a>
|
|
1380
|
+
|
|
1381
|
+
### DoubleLinker.make(linker, [linkerClass]) ⇒ [<code>Linker</code>](#Linker)
|
|
1382
|
+
Make a new DoubleLinker from the data given if it is not already a valid Linker.
|
|
1383
|
+
|
|
1384
|
+
**Kind**: static method of [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1385
|
+
**Methodof**: DoubleLinker
|
|
1386
|
+
|
|
1387
|
+
| Param | Type | Default |
|
|
1388
|
+
| --- | --- | --- |
|
|
1389
|
+
| linker | [<code>DoubleLinker</code>](#DoubleLinker) \| <code>\*</code> | |
|
|
1390
|
+
| [linkerClass] | [<code>DoubleLinker</code>](#DoubleLinker) | <code>DoubleLinker</code> |
|
|
1391
|
+
|
|
1392
|
+
<a name="DoubleLinker.fromArray"></a>
|
|
1393
|
+
|
|
1394
|
+
### DoubleLinker.fromArray([values], [linkerClass]) ⇒ <code>Object</code>
|
|
1395
|
+
Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
|
|
1396
|
+
|
|
1397
|
+
**Kind**: static method of [<code>DoubleLinker</code>](#DoubleLinker)
|
|
1398
|
+
**Methodof**: DoubleLinker
|
|
1399
|
+
|
|
1400
|
+
| Param | Type | Default |
|
|
1401
|
+
| --- | --- | --- |
|
|
1402
|
+
| [values] | <code>Array</code> | <code>[]</code> |
|
|
1403
|
+
| [linkerClass] | [<code>DoubleLinker</code>](#DoubleLinker) | <code>DoubleLinker</code> |
|
|
1404
|
+
|
|
1405
|
+
<a name="Arrayable"></a>
|
|
1406
|
+
|
|
1407
|
+
## Arrayable
|
|
1408
|
+
DoublyLinkedList represents a collection stored as a LinkedList with prev and next references.
|
|
1409
|
+
|
|
1410
|
+
**Kind**: global class
|
|
1411
|
+
|
|
1412
|
+
* [Arrayable](#Arrayable)
|
|
1413
|
+
* [new Arrayable(classType)](#new_Arrayable_new)
|
|
1414
|
+
* _instance_
|
|
1415
|
+
* [.classType](#Arrayable+classType) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1416
|
+
* [.initialized](#Arrayable+initialized) ⇒ <code>boolean</code>
|
|
1417
|
+
* [.innerList](#Arrayable+innerList) ⇒ <code>Array</code>
|
|
1418
|
+
* [.first](#Arrayable+first) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1419
|
+
* [.last](#Arrayable+last) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1420
|
+
* [.length](#Arrayable+length) ⇒ <code>number</code>
|
|
1421
|
+
* [.initialize(initialList)](#Arrayable+initialize) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1422
|
+
* [.insertAfter(node, newNode)](#Arrayable+insertAfter) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1423
|
+
* [.insertBefore(node, newNode)](#Arrayable+insertBefore) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1424
|
+
* [.append(node, after)](#Arrayable+append) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1425
|
+
* [.prepend(node, before)](#Arrayable+prepend) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1426
|
+
* [.remove(node)](#Arrayable+remove) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1427
|
+
* [.item(index)](#Arrayable+item) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
1428
|
+
* [.forEach(callback, thisArg)](#Arrayable+forEach) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1429
|
+
* _static_
|
|
1430
|
+
* [.fromArray(values, elementClass, classType)](#Arrayable.fromArray) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1431
|
+
|
|
1432
|
+
<a name="new_Arrayable_new"></a>
|
|
1433
|
+
|
|
1434
|
+
### new Arrayable(classType)
|
|
1435
|
+
Create the new Arrayable instance, configure the Arrayable class.
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
| Param | Type |
|
|
1439
|
+
| --- | --- |
|
|
1440
|
+
| classType | [<code>Arrayable</code>](#Arrayable) \| <code>Iterable</code> |
|
|
1441
|
+
|
|
1442
|
+
<a name="Arrayable+classType"></a>
|
|
1443
|
+
|
|
1444
|
+
### arrayable.classType ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1445
|
+
Return the type of class used for Arrayable.
|
|
1446
|
+
|
|
1447
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1448
|
+
<a name="Arrayable+initialized"></a>
|
|
1449
|
+
|
|
1450
|
+
### arrayable.initialized ⇒ <code>boolean</code>
|
|
1451
|
+
Detect if the inner list has been initialized.
|
|
1452
|
+
|
|
1453
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1454
|
+
<a name="Arrayable+innerList"></a>
|
|
1455
|
+
|
|
1456
|
+
### arrayable.innerList ⇒ <code>Array</code>
|
|
1457
|
+
Retrieve a copy of the innerList used.
|
|
1458
|
+
|
|
1459
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1460
|
+
<a name="Arrayable+first"></a>
|
|
1461
|
+
|
|
1462
|
+
### arrayable.first ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1463
|
+
Retrieve the first Element from the Arrayable
|
|
1464
|
+
|
|
1465
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1466
|
+
<a name="Arrayable+last"></a>
|
|
1467
|
+
|
|
1468
|
+
### arrayable.last ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1469
|
+
Retrieve the last Element from the Arrayable
|
|
1470
|
+
|
|
1471
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1472
|
+
<a name="Arrayable+length"></a>
|
|
1473
|
+
|
|
1474
|
+
### arrayable.length ⇒ <code>number</code>
|
|
1475
|
+
Return the length of the list.
|
|
1476
|
+
|
|
1477
|
+
**Kind**: instance property of [<code>Arrayable</code>](#Arrayable)
|
|
1478
|
+
<a name="Arrayable+initialize"></a>
|
|
1479
|
+
|
|
1480
|
+
### arrayable.initialize(initialList) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1481
|
+
Initialize the inner list, should only run once.
|
|
1482
|
+
|
|
1483
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1484
|
+
|
|
1485
|
+
| Param | Type |
|
|
1486
|
+
| --- | --- |
|
|
1487
|
+
| initialList | [<code>ArrayElement</code>](#ArrayElement) \| <code>Array</code> |
|
|
1488
|
+
|
|
1489
|
+
<a name="Arrayable+insertAfter"></a>
|
|
1490
|
+
|
|
1491
|
+
### arrayable.insertAfter(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1492
|
+
Insert a new node (or data) after a node.
|
|
1493
|
+
|
|
1494
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1495
|
+
|
|
1496
|
+
| Param | Type |
|
|
1497
|
+
| --- | --- |
|
|
1498
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> |
|
|
1499
|
+
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> |
|
|
1500
|
+
|
|
1501
|
+
<a name="Arrayable+insertBefore"></a>
|
|
1502
|
+
|
|
1503
|
+
### arrayable.insertBefore(node, newNode) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1504
|
+
Insert a new node (or data) before a node.
|
|
1505
|
+
|
|
1506
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1507
|
+
|
|
1508
|
+
| Param | Type |
|
|
1509
|
+
| --- | --- |
|
|
1510
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> |
|
|
1511
|
+
| newNode | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> |
|
|
1512
|
+
|
|
1513
|
+
<a name="Arrayable+append"></a>
|
|
1514
|
+
|
|
1515
|
+
### arrayable.append(node, after) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1516
|
+
Add a node (or data) after the given (or last) node in the list.
|
|
1517
|
+
|
|
1518
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1519
|
+
|
|
1520
|
+
| Param | Type |
|
|
1521
|
+
| --- | --- |
|
|
1522
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> |
|
|
1523
|
+
| after | [<code>ArrayElement</code>](#ArrayElement) |
|
|
1524
|
+
|
|
1525
|
+
<a name="Arrayable+prepend"></a>
|
|
1526
|
+
|
|
1527
|
+
### arrayable.prepend(node, before) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1528
|
+
Add a node (or data) before the given (or first) node in the list.
|
|
1529
|
+
|
|
1530
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1531
|
+
|
|
1532
|
+
| Param | Type |
|
|
1533
|
+
| --- | --- |
|
|
1534
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> |
|
|
1535
|
+
| before | [<code>ArrayElement</code>](#ArrayElement) |
|
|
1536
|
+
|
|
1537
|
+
<a name="Arrayable+remove"></a>
|
|
1538
|
+
|
|
1539
|
+
### arrayable.remove(node) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1540
|
+
Remove an element from this arrayable.
|
|
1541
|
+
|
|
1542
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1543
|
+
|
|
1544
|
+
| Param | Type |
|
|
1545
|
+
| --- | --- |
|
|
1546
|
+
| node | [<code>ArrayElement</code>](#ArrayElement) |
|
|
1547
|
+
|
|
1548
|
+
<a name="Arrayable+item"></a>
|
|
1549
|
+
|
|
1550
|
+
### arrayable.item(index) ⇒ [<code>ArrayElement</code>](#ArrayElement) \| <code>null</code>
|
|
1551
|
+
Retrieve a DoubleLinker item from this list by numeric index, otherwise return null.
|
|
1552
|
+
|
|
1553
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1554
|
+
|
|
1555
|
+
| Param | Type |
|
|
1556
|
+
| --- | --- |
|
|
1557
|
+
| index | <code>number</code> |
|
|
1558
|
+
|
|
1559
|
+
<a name="Arrayable+forEach"></a>
|
|
1560
|
+
|
|
1561
|
+
### arrayable.forEach(callback, thisArg) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1562
|
+
Be able to run forEach on this Arrayable to iterate over the elements.
|
|
1563
|
+
|
|
1564
|
+
**Kind**: instance method of [<code>Arrayable</code>](#Arrayable)
|
|
1565
|
+
|
|
1566
|
+
| Param | Type |
|
|
1567
|
+
| --- | --- |
|
|
1568
|
+
| callback | [<code>forEachCallback</code>](#forEachCallback) |
|
|
1569
|
+
| thisArg | [<code>Arrayable</code>](#Arrayable) |
|
|
1570
|
+
|
|
1571
|
+
<a name="Arrayable.fromArray"></a>
|
|
1572
|
+
|
|
1573
|
+
### Arrayable.fromArray(values, elementClass, classType) ⇒ [<code>Arrayable</code>](#Arrayable)
|
|
1574
|
+
Convert an array to an Arrayable.
|
|
1575
|
+
|
|
1576
|
+
**Kind**: static method of [<code>Arrayable</code>](#Arrayable)
|
|
1577
|
+
**Methodof**: Arrayable
|
|
1578
|
+
|
|
1579
|
+
| Param | Type |
|
|
1580
|
+
| --- | --- |
|
|
1581
|
+
| values | <code>Array</code> |
|
|
1582
|
+
| elementClass | [<code>ArrayElement</code>](#ArrayElement) |
|
|
1583
|
+
| classType | [<code>Arrayable</code>](#Arrayable) \| <code>Iterable</code> |
|
|
1584
|
+
|
|
1585
|
+
<a name="ArrayElement"></a>
|
|
1586
|
+
|
|
1587
|
+
## ArrayElement
|
|
1588
|
+
Element represents a node in an Arrayable.
|
|
1589
|
+
|
|
1590
|
+
**Kind**: global class
|
|
1591
|
+
|
|
1592
|
+
* [ArrayElement](#ArrayElement)
|
|
1593
|
+
* [new ArrayElement([data], [elementClass])](#new_ArrayElement_new)
|
|
1594
|
+
* _instance_
|
|
1595
|
+
* [.classType](#ArrayElement+classType) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1596
|
+
* _static_
|
|
1597
|
+
* [.make(element, [elementClass])](#ArrayElement.make) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1598
|
+
* [.fromArray([values], [elementClass])](#ArrayElement.fromArray) ⇒ <code>Object</code>
|
|
1599
|
+
|
|
1600
|
+
<a name="new_ArrayElement_new"></a>
|
|
1601
|
+
|
|
1602
|
+
### new ArrayElement([data], [elementClass])
|
|
1603
|
+
Create the new Element instance, provide the data and optionally configure the type of Element.
|
|
1604
|
+
|
|
1605
|
+
|
|
1606
|
+
| Param | Type | Default |
|
|
1607
|
+
| --- | --- | --- |
|
|
1608
|
+
| [data] | <code>\*</code> | <code></code> |
|
|
1609
|
+
| [elementClass] | [<code>ArrayElement</code>](#ArrayElement) | <code>Element</code> |
|
|
1610
|
+
|
|
1611
|
+
<a name="ArrayElement+classType"></a>
|
|
1612
|
+
|
|
1613
|
+
### arrayElement.classType ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1614
|
+
Return the type of class used for Element.
|
|
1615
|
+
|
|
1616
|
+
**Kind**: instance property of [<code>ArrayElement</code>](#ArrayElement)
|
|
1617
|
+
<a name="ArrayElement.make"></a>
|
|
1618
|
+
|
|
1619
|
+
### ArrayElement.make(element, [elementClass]) ⇒ [<code>ArrayElement</code>](#ArrayElement)
|
|
1620
|
+
Make a new Element from the data given if it is not already a valid Element.
|
|
1621
|
+
|
|
1622
|
+
**Kind**: static method of [<code>ArrayElement</code>](#ArrayElement)
|
|
1623
|
+
**Methodof**: ArrayElement
|
|
1624
|
+
|
|
1625
|
+
| Param | Type | Default |
|
|
1626
|
+
| --- | --- | --- |
|
|
1627
|
+
| element | [<code>ArrayElement</code>](#ArrayElement) \| <code>\*</code> | |
|
|
1628
|
+
| [elementClass] | [<code>ArrayElement</code>](#ArrayElement) | <code>Element</code> |
|
|
1629
|
+
|
|
1630
|
+
<a name="ArrayElement.fromArray"></a>
|
|
1631
|
+
|
|
1632
|
+
### ArrayElement.fromArray([values], [elementClass]) ⇒ <code>Object</code>
|
|
1633
|
+
Convert an array into Element instances, return the head and tail Elements.
|
|
1634
|
+
|
|
1635
|
+
**Kind**: static method of [<code>ArrayElement</code>](#ArrayElement)
|
|
1636
|
+
**Methodof**: ArrayElement
|
|
1637
|
+
|
|
1638
|
+
| Param | Type | Default |
|
|
1639
|
+
| --- | --- | --- |
|
|
1640
|
+
| [values] | <code>Array</code> | <code>[]</code> |
|
|
1641
|
+
| [elementClass] | [<code>ArrayElement</code>](#ArrayElement) | <code>Element</code> |
|
|
1642
|
+
|
|
1643
|
+
<a name="recipes"></a>
|
|
1644
|
+
|
|
1645
|
+
## recipes : <code>Object</code>
|
|
1646
|
+
List of class declarations that can be used to specify attributes for a style of object / class.
|
|
1647
|
+
|
|
1648
|
+
**Kind**: global constant
|
|
1649
|
+
<a name="completeResponse"></a>
|
|
1650
|
+
|
|
1651
|
+
## completeResponse : <code>Object</code>
|
|
1652
|
+
Return results of the task.
|
|
1653
|
+
|
|
1654
|
+
**Kind**: global typedef
|
|
1655
|
+
**Properties**
|
|
1656
|
+
|
|
1657
|
+
| Name | Type |
|
|
1658
|
+
| --- | --- |
|
|
1659
|
+
| success | <code>\*</code> |
|
|
1660
|
+
| error | <code>\*</code> |
|
|
1661
|
+
| context | <code>\*</code> |
|
|
1662
|
+
|
|
1663
|
+
<a name="forEachCallback"></a>
|
|
1664
|
+
|
|
1665
|
+
## forEachCallback ⇒
|
|
1666
|
+
Run this function for each element in this arrayable.
|
|
1667
|
+
|
|
1668
|
+
**Kind**: global typedef
|
|
1669
|
+
**Returns**: void
|
|
1670
|
+
|
|
1671
|
+
| Param | Type |
|
|
1672
|
+
| --- | --- |
|
|
1673
|
+
| element | [<code>ArrayElement</code>](#ArrayElement) |
|
|
1674
|
+
| index | <code>number</code> |
|
|
1675
|
+
| thisArg | [<code>Arrayable</code>](#Arrayable) |
|
|
1676
|
+
|