poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 58525] [PATCH] Optimization of adding/modifying named cells
Date Fri, 23 Oct 2015 12:05:02 GMT

--- Comment #4 from Javen ONeal <javenoneal@gmail.com> ---
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.

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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message