I am making a Java application and Im having some doubts about performance.
I have a PriorityQueue that ensures that the deleted item is the one with the highest priority. This PriorityQueue has instances of the Event class (which implements the Comparable interface). Each event is associated with an entity .
The size of this priority can be huge, and very often I will have to delete events related to the entity.
Right now I am using an iterator to run all priority. However, I find it difficult, and I wonder if there are better alternatives for finding and deleting events related to the "xpto" entity.
Any suggestions?
Thank!
source
share