commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hasan Diwan <>
Subject Re: [dbutils]
Date Mon, 19 Dec 2011 16:54:40 GMT
On 19 December 2011 01:03, aris2world <> wrote:
> I don't have a generic order for keys, my order is the same of the fields
> in select list:
> select <col1>, <col2>, ..., <coln> from ...
> when the resultset of this query is mapped, values in the map are inserted
> in this order <col1>, <col2>, ..., <coln>.
> I'd like that map.keySet().iterator() let me iterate over values in that
> order, i.e. insertion-order.
> This is a custom order but I have to parse the query to get it. I think it
> should be the order that a client would expect.
> From the LinkedHashMap javadoc:
> "This implementation spares its clients from the unspecified, generally
> chaotic ordering provided by
> HashMap<>
>  (and Hashtable<
> without incurring the increased cost associated with
> TreeMap<>
Wasn't aware of the LinkedHashMap, but would this not work:
LinkedHashMap map = new LinkedHashMap(foo.toMap());
Sent from my mobile device
Envoyait de mon portable

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message