I have a sorted map and want to reference its ordered objects by their index position. Is this possible? How would I convert a sorted map to an array list while maintaining the ordering, so I can retrieve an object by its index (order). Is this the only way to do it?
Ideally I could have this structure, and would know the index of an object within that strucre and could rertieve it by saying:
Object nextObj = structure[4] //this structure is originally a sortedMap
//SortedMap<String, Object> sortedMap = new TreeMap<String, Object>();
My issue is that I have a sorted map to work with in the first place. Is there a known way to do this?
Many thanks for suggesting any approaches to this.