Package icyllis.arc3d.engine
Interface PriorityQueue.Access<E>
- Type Parameters:
E
- the type of elements held in this queue
- Enclosing class:
PriorityQueue<E>
public static interface PriorityQueue.Access<E>
This allows us to store the index into the element itself to improve the performance
of inserting or removing elements. Without this mechanism, it will iterate through
the queue to find the index.
-
Method Summary
-
Method Details
-
setIndex
Stores the new index into the element. An index of -1 means the element is removed from the queue.- Parameters:
e
- an element of the queueindex
- the new index of the element in the queue, or -1
-
getIndex
Retrieves the index previously stored into the element. An index of -1 means the element is removed from the queue.- Parameters:
e
- an element of the queue- Returns:
- the index of the element in the queue, or -1
-