I'm writing a program using A* for a computer class and cannot seem to get the contains method to function how I need it to. I am using a pair of Priority Queues to hold objects of a Node class, which I defined. I wrote an equals method in the Node class, and it works fine on an individual basis, and, as far as I can tell, it will also override the base equals method from the Object class, when I call it by itself.
Calling the contains method though, will not detect Nodes that are the "same". I was under the impression that contains uses equals to determine if the Queue does indeed contain the object in question. I've messed with it, and have become quite stumped as to the reason, leading me to believe that my understanding of the way contains works is flawed, but, as far as I can tell by the Java documentation, it looks like it should work.
Any suggestions or pointers in the right direction would be greatly appreciated, thanks.