| @@ -137,6 +137,28 @@ | ||
| 137 | 137 | queue[offset] = item; |
| 138 | 138 | return true; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | + /** | |
| 142 | + * Checks if any queue object/element contains the ID | |
| 143 | + * | |
| 144 | + * @param {string} id The ID to search for. | |
| 145 | + * | |
| 146 | + * @return {boolean} Whether any queue object/element contains the ID. | |
| 147 | + */ | |
| 148 | + this.contains_id = function (id) { | |
| 149 | + return queue.slice(offset).some(function (ele) { | |
| 150 | + return ele && typeof ele === 'object' && ele.optimization_id === id; | |
| 151 | + }); | |
| 152 | + } | |
| 153 | + | |
| 154 | + /** | |
| 155 | + * Returns a copy of all items currently in the queue. | |
| 156 | + * | |
| 157 | + * @returns {Array} - An array of all current items in the queue. | |
| 158 | + */ | |
| 159 | + this.get_all_items = function () { | |
| 160 | + return queue.slice(offset); | |
| 161 | + } | |
| 162 | + | |
| 141 | 163 | } |
| 142 | 164 | |