getItems static method
Implementation
static List<Object> getItems(PriorityQueue kNearestNeighbors) {
/**
* Iterate the K Nearest Neighbour Queue and retrieve the item from each BoundablePair
* in this queue
*/
List<Object> items = []; //..length = kNearestNeighbors.size();
// int count = 0;
while (!kNearestNeighbors.isEmpty()) {
BoundablePair bp = kNearestNeighbors.poll() as BoundablePair;
items.add((bp.getBoundable(0) as ItemBoundable).getItem());
// items[count] = (bp.getBoundable(0) as ItemBoundable).getItem();
// count++;
}
return items;
}