[jdom-interest] HashMap/HashSet for attributes/childs

Oliver Imbusch flabes at livis.de
Fri Aug 18 02:01:20 PDT 2000


Hi,

[ I'm new to this list, so apologize if I'm asking a FAQ; BTW, adding
a search capability to the archive would be a great plus. ]

Inspecting the source code of Element.java, I've seen that both
getChild() and getAttribute() iterate over the complete list of
childs/attributes to find a particular element. Wouldn't it be faster
to maintain a HashMap/HashSet for that purpose? This would also free
from implementing the replacement logic in addAttribute() (marked as
TODO there). Both Map and HashMap are imported but never used.

Ciao
	Oliver



More information about the jdom-interest mailing list