How often do you use nested hashtables in Java? Do you find their convenience
worth the trade-off in complexity, or do you try to avoid them altogether?
Re: nested hashtables
"Lori Piquet" <email@example.com> wrote:
>How often do you use nested hashtables in Java? Do you find their convenience
>worth the trade-off in complexity, or do you try to avoid them altogether?
It happens all the time if you port to Java the Perl model of universe -
hashes consisting of arrays of hashes etc.
Say, a typical Perl expression would look like
So, if we handle this with pleasure in Perl, it makes sense to do the same
I would also add that the idea of writing
String value = (String)((HashTable)(myHashTable.get("masterKey")).get("slaveKey");
is not good at all - if myHashTable doe snot have "masterKey", all we get
is a null-pointer exception. Having NotatedHashTable handle this issue would
be just great.
Also, a good example is an imported XML structure, where one will want to
navigate all the time.
But then, does not it imply that actually, instead of introducing a version
of XPath search, maybe reduced for the reduced case of hashes of arrays of
Still, even in this "Notated Hash" version, the idea is very good
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center