Search through this forum; how to implement hashCode and equals methods comes up every now and again. The principles are the same, and are described in Object, here and here. If you get your hands on a copy of Effective Java by Joshua Bloch there is a chapter about that sort of methods.
To implement a hashCode, try the hashCode of the class name, then multiply by 31 and add the hashCode for your first field, then multiply by 31 and add . . . Every field used in "equals" must be used for the hashCode too.
To implement equals, remember you might pass the same object, so if this == obj is true, you don't need to check any more. You will have to check that the other object isn't null, that it is of the same class, then cast obj and that each of its fields is equal to the corresponding field of this. You need the @Override annotation for both methods. If you try it, you will find that I have written the instructions in that order for a good reason!
Joined: Mar 21, 2007
Joined: Oct 13, 2005
I presume you got it to work well done.
subject: Implementing hashcode and equals method in a Map