Could we have a string key and sort the keys before looping over the object?
Date: Mon, 14 Jul 2008 08:33:53 +0000
Subject: [json] JSON and sorted Data
JSON does not preserve the data sorting.
I fetched the sorted data from DB and put in json object to be shown
in a list box. The sorting order is not preserved because JSONObject
internally uses a HashMap which does not guarantee the sorting order
Can there be an implementation that uses LinkedHashMap which will
preserve the sorting order.
I thought of extending the JSONObject but since myHashMap is private
this would not do. Also if the myHashMap is a Map interface the we can
use the internal storage object of any Map implementation.
Want to help Windows Live Messenger plant more Aussie trees?
[Non-text portions of this message have been removed]