Efficient data structures collection

Hello,

I am looking for an efficient collection of java classes which construct sort of a "database" on the fly - so that I could make queries and iterate through objects according to a certain cut (I don't mind if I need to specify the kind of cuts ahead as long as I can dynamically add objects and the cuts will be updated accordingly).

So, for example, if I have objects of the form

class UserName

{

public:

String userName;

}

I would like to have a quick index for all users which their names contain a certain string (this was just a simple example).

I looked around and found trove, but I don't think it can do such things.

Any ideas? Basically, I am looking for "a database on the fly" where you can query for objects using "semi-SELECT" stataements.

Speed and memory are the most important issues for me here...

Thanks,

Jerr.

[922 byte] By [jerra] at [2007-11-27 4:28:14]
# 1
maybe you should look for real database management systems and try to create "in-memory" tables so that your speed requirement is met.
Dalzhima at 2007-7-12 9:36:57 > top of Java-index,Core,Core APIs...
# 2
have you tried hash maps?thanks
geomana at 2007-7-12 9:36:57 > top of Java-index,Core,Core APIs...