David Galea wrote:I was wondering if it is possible to create another integer type that had self defined bounds, or if anyone knows of someone/organisation/etc that have implemented such types?
Well, I'm pretty sure that Google have done a lot of work on huge "arrays".
However, like the others, I reckon that a database is your best option for storing the actual data, since handling huge amounts of it is
precisely what databases were designed for.
A possible wrinkle you could try, though, would be a
cache, implemented as a LinkedHashMap.
For example, you could easily set up a
LinkedHashMap<Long, Short>, with a key set up as Jeff described, that holds, say, 25 million entries (or some power of two, multiplied by 0.75), and use it as a "most recently used" cache buffer. If there is any pattern to your access, you may find a size where you get lots of "hits" from such a cache, which then saves you the business of having to call the database, which will be a LOT slower than retrieving from an LHM.
Good luck, and good hunting.
Winston