Indexing object

Is there any product out there that alows me to index objects?

It should behaive much like an database index.

What I want is this:

I have an object that has four fields(formName, fieldName, propertyName, propertyValue) and I'd like to index this object in order to retrieve it.

There are caching products out there, but they allow only one index and I want that one object is index by multiple indexes. What does this mean: Cache products have one method for adding an object in a cache(addObject(String key, Object objectToAdd)) and I'd like to do:

addKey("formName,fieldName");

addKey("formName,fieldName, propertyName");

addObject(obj);

and this addObject would index the obj by two indexes.

I hope I was clear enough and that someone did something like this.

Best regards,

Kovi

[856 byte] By [Kovicaa] at [2007-10-2 20:11:42]
# 1

You just create a cache with four hashes. Each hash indexes via a different key. Wrap it in a class so that adds, removes, etc are handled correctly.

Note that normally there will only be one value for each of the four entries. So if you intend to change things, like propertyValue then you will have to rehash it.

jschella at 2007-7-13 22:52:17 > top of Java-index,Other Topics,Algorithms...