https://bz.apache.org/bugzilla/show_bug.cgi?id=58525
--- Comment #4 from Javen ONeal <[email protected]> --- There might be some off-the-shelf solutions available for this, though the underlying implementation of MultiKeyMap would determine if this saves any memory over maintaining a List and a Map in parallel--at least a hybrid data structure would relieve the developers of touching twice as many data structures and twice as many functions. https://commons.apache.org/proper/commons-collections/javadocs/api-3.2.1/org/apache/commons/collections/map/MultiKeyMap.html Alternatively, if the performance hit is small enough, some type of SortedMap/TreeMap/LinkedHashMap might work here: getName(int index) -> map.values().toArray()[index] If those suggestions don't work, you could roll your own hybrid data structure to maintain two underlying data structures in parallel. Better encapsulation. > (In reply to Richard Hart from comment #3) > If I am not mistaken, the names array also contains names that are empty > ("") such as when the cell is first created. Giving the cell a name is not > required. The map can have only one empty name. So there is a difference > between the two stores. The map contains only names whose length > 0. Hmm.. another wrinkle in the design. Let me think about this problem a bit more. It's starting to sound like a custom-built hybrid data structure will be needed here. Maybe that custom data structure is LinkTable.java. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
