Hello,
Can I use Collections.binarySearch() method to search elements in a PriorityQueue? Otherwise, how can I apply search algorithms to a PriorityQueue?
I have this (class Evento implements Comparable):
public class PriorityQueueCAP extends PriorityQueue<Evento>{
// (...)
public void removeEventos(Evento evento){
Collections.binarySearch(this, evento); // ERROR!
}
}
And I got this error: "The method binarySearch(List>, T) in the type Collections is not applicable for the arguments (PriorityQueueCAP, Evento)"
Why?
Thanks in advance!