commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Plotnikov" <dmi...@apache.org>
Subject Re: [JXPath] indexing List properties for xpath
Date Mon, 14 Jun 2004 13:28:42 GMT
Andy,

A possible solution might be to use the KeyManager interface.

See:
http://jakarta.apache.org/commons/jxpath/apidocs/org/apache/commons/jxpath/KeyManager.html

Then you can use the key(keyName,keyValue)

Let me know if this helps.

- Dmitri

----- Original Message ----- 
From: "Andy Depue" <andy@marathon-man.com>
To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
Sent: Friday, June 11, 2004 4:17 PM
Subject: [JXPath] indexing List properties for xpath


> I have an object model that contains several very large List properties,
such
> as:
>   public List getRelations();
> The List could contain thousands of elements.  I am able to query such
List
> properties using JXPath:
>   relations[entity/id=12]
> However, since the List can be extremely large, and since the object model
> doesn't give me much freedom to change it (such as replacing the List with
a
> Map), searching the enter List can be very slow and I'm seeing it impact
> performance.  I would like to somehow index the property, much like you
would
> index a table in a DB.  I'm thinking of creating an indexing interface for
my
> project, something I could use like so:
>   indexor.indexProperty(contextObject, "relations", "entity/id");
> Which would index all elements in the "relations" List property on their
> "entity/id" property.  Thus, whenever an XPath filters a node selection
based
> on the entity/id property, it would pick up and use the index instead of
> scanning the entire List (much like a DB).  Before I plunge into JXPath
> source code, I thought it might be worth asking if anyone who is familiar
> with JXPath could recommend the best way to modify/extend JXPath in order
to
> implement this indexing scheme for my project?
>
> Thanks,
>   Andy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message