|
-
Apr 26th, 2006, 11:20 PM
#1
Re: collection class
I didn't think that Hashtables altered the order either but I just tested it and it did indeed order the items by key. I guess there must be no guarantee that this will be the case though, otherwsie the SortedList wouldn't exist. To solve your issue you could keep an internal ArrayList or some other collection with the keys in the order you want. When you want to get the items you would then iterate through the ArrayList to get the keys in order, and use each key to get the corresponding value from the Hashtable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|