I have a project where I have a class Halfedge (olny .class file, so no way to modify it).
I want to create a PriorityQueue.
In order to determine which element is bigger, I need not only the fields inside the Halfedge class, but also a HashMap that I create in my code.
The thing is: when I define the Comparator class specific for the Halfedge, I cannot include any parameters.
My question is: how can I implement a comparator class for my Halfedge class using outside parameters? (or simply, how shoul I construct that PriorityQueue)
Thanks a lot!
Please take a look at the following code:
and the client code may be: