Implements the various functions of a queue data structure, using the specified name-space on the D-data structure.
- Copyright:
- Copyright © 2022-… by Seth Hollingsead. All rights reserved
- Source:
Requires
Methods
(inner) dequeue(queueNameSpace) → {string}
Gets the entity at the front of the queue, removes it from the queue and returns that entity.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace the queue array should be dequeued from. |
- Source:
Returns:
The item at the front of the queue and removes it from the queue.
- Type
- string
(inner) enqueue(queueNameSpace, value) → {void}
Adds the value to the specified namespace queue.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace the queue array should have a value added to. |
value |
string | The value that should be added to the specified queue array. |
- Source:
Returns:
- Type
- void
(inner) enqueueFront(queueNameSpace, value) → {void}
Adds the value to the front of the specified namespace queue.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace the queue array should have a value added to. |
value |
strng | array.<string> | Teh value that should be added to the specified queue array, it could be a string value or an array of string values. |
- Source:
Returns:
- Type
- void
(inner) initQueue(queueNameSpace) → {void}
Initializes the queue with the provided namespace.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace the queue array should be created under. |
- Source:
Returns:
- Type
- void
(inner) isEmpty(queueNameSpace) → {boolean}
Determines if the queue is empty or not empty.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace the queue array should have a value added to. |
- Source:
Returns:
True or False to indicate if the queue is empty or not empty.
- Type
- boolean
(inner) queueContents(queueNameSpace) → {array.<string>}
Returns the contents of the queue as an array.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace of the queue who's contents should be returned as an array. |
- Source:
Returns:
The entire queue and it's contents as an array.
- Type
- array.<string>
(inner) queueFront(queueNameSpace) → {string}
Gets the entity at the front of the queue.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace the queue array from which the front of the queue should be found. |
- Source:
Returns:
The entity at the front of the queue.
- Type
- string
(inner) queuePrint(queueNameSpace) → {void}
Prints out the queue as specified by the namespace input parameter.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace that should be used to print out the contents of the queue on the D-data structure. |
- Source:
Returns:
- Type
- void
(inner) queueSize(queueNameSpace) → {integer}
Gets the current size of the queue.
Parameters:
| Name | Type | Description |
|---|---|---|
queueNameSpace |
string | The namespace of the queue array from which we should get the current queue size. |
- Source:
Returns:
A count for the number of entities in the specified queue.
- Type
- integer