I'm looking for an in-memory map with java-friendly APIs (not necessarily java) that supports range queries. Our design doesn't yet call for it to be distributed.
Any suggestions? Thanks!
Use a TreeMap. A range query can be done using the methods lowerEntry
and higherEntry
, higherKey
and lowerKey
. Find the first key smaller than the left end of the range, the first key bigger than the right one and return everything between them.