Class HeapPriorityQueueSet<T extends HeapPriorityQueueElement>

Type Parameters:
T - type of the contained elements.
All Implemented Interfaces:
InternalPriorityQueue<T>, KeyGroupedInternalPriorityQueue<T>

public class HeapPriorityQueueSet<T extends HeapPriorityQueueElement> extends HeapPriorityQueue<T> implements KeyGroupedInternalPriorityQueue<T>
A heap-based priority queue with set semantics, based on HeapPriorityQueue. The heap is supported by hash set for fast contains (de-duplication) and deletes. Object identification happens based on Object.equals(Object).

Possible future improvements:

  • We could also implement shrinking for the heap and the deduplication set.
  • We could replace the deduplication maps with more efficient custom implementations. In particular, a hash set would be enough if it could return existing elements on unsuccessful adding, etc..