Hello,
maybe I am missing something completely. But as far as I understand this, there seems to be no direct way of getting an Enumeration
directly for the Keys of a HashMap
. I can only get a keySet()
. From that Set I can get an Iterator
but an Iterator seems to be something different than an Enumeration.
What is the best and most performant way to directly get an Enumeration from the Keys of a HashMap?
Background: I am implementing my own ResourceBundle ([http://java.sun.com/javase/6/docs/api/java/util/ResourceBundle.html#getKeys[1]
=>getKeys()
Method) and I have to provide/implement a method that returns the Enumeration of all Keys. But my implementation is based on a HashMap so I need to somehow figure out how to best convert betweens these two "Iterator/Enuerator" techniques.
Thank you very much Tim