Monday, February 18, 2002 05:22 PM
If the data are fairly static, there's no reason not to keep each "index" in a separate data structure.
Don't forget that the data will be shared, so the overhead of, say, two HashMaps will be justified given the performance increase for lookups.
Iterating through a data set can be time consuming. I suggest using a sorted Collection that uses a custom Comparator (for each index), and you'll probably get log2 complexity for lookups in, say, a tree.