You should familiarize yourself with the
Java API documentation for the version of Java you are using. It provides a great reference to find methods of specific classes that will accomplish the task at hand.
However, you also need to know what classes and methods are available. One place to start is the
Java Tutorial. In particular, you may find that the
Collections trail is a good resource as an overview of what is available from the Collections API (which includes HashMap).
If you look through this documentation, you will quickly find that a simple call to HashMap.get() will do what you need just as Ilja was trying to point out, unless I completly misunderstood your question, of course.
I hope this helps.
Keep Coding!
Layne