You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Saman Ghodsian <gs...@shaw.ca> on 2003/06/26 21:10:14 UTC

Sorted list

Hi everyone,

I've been trying to find a way to have a sorted list where I can do a
get method on the key, right now I'm using to lists, one that I have
implemented based on the java SortedMap list and a vector, then when OJB
uses the setList method I go and add all the elements to the sorted map,
and viceversa.... Problem is of course performance.... I've been looking
in implementing my Sorted List by implementing the ManageableCollection
Interface, the question Is if that's all I would need to do? Just
implement those methods and have my repository collection tag to my own
?
Anyone has come across this before? Any hints appreciated

Thanks,



Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada



RE: Sorted list

Posted by Saman Ghodsian <gs...@shaw.ca>.

Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada



> -----Original Message-----
> From: thma32@web.de [mailto:thma32@web.de] 
> Sent: Thursday, June 26, 2003 12:34 PM
> To: OJB Users List
> Subject: Re: Sorted list
> 
> 
> Hi,
> 
> Saman Ghodsian wrote:
> > Hi everyone,
> > 
> > I've been trying to find a way to have a sorted list where 
> I can do a 
> > get method on the key, right now I'm using to lists, one 
> that I have 
> > implemented based on the java SortedMap list and a vector, 
> then when 
> > OJB uses the setList method I go and add all the elements to the 
> > sorted map, and viceversa.... Problem is of course performance.... 
> > I've been looking in implementing my Sorted List by 
> implementing the 
> > ManageableCollection Interface, the question Is if that's 
> all I would 
> > need to do? Just implement those methods and have my repository 
> > collection tag to my own ?
> 
> yes, that should be sufficient. have a look at 
> org.apache.ojb.broker.util.collections.ManageableHashSet for 
> an example. It is a HashSet that implements the 
> ManageableCollection interface.
Ok I'll try that way

> Are you willing to share your Map class? I'd love to add more user 
> defined ManageableCollections to the util.collections package.
For sure, I'll let you know when I'm done and tested the solution

> cheers,
> Thomas
> 
> > Anyone has come across this before? Any hints appreciated
> > 
> > Thanks,
> > 
> > 
> > 
> > Saman Ghodsian
> > CTO
> > Middle Earth Technologies Ltd.
> > www.metca.com
> > Cell (604)-839-7791
> > Vancouver, BC
> > Canada
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 


Re: Sorted list

Posted by Thomas Mahler <th...@web.de>.
Hi,

Saman Ghodsian wrote:
> Hi everyone,
> 
> I've been trying to find a way to have a sorted list where I can do a
> get method on the key, right now I'm using to lists, one that I have
> implemented based on the java SortedMap list and a vector, then when OJB
> uses the setList method I go and add all the elements to the sorted map,
> and viceversa.... Problem is of course performance.... I've been looking
> in implementing my Sorted List by implementing the ManageableCollection
> Interface, the question Is if that's all I would need to do? Just
> implement those methods and have my repository collection tag to my own
> ?

yes, that should be sufficient. have a look at 
org.apache.ojb.broker.util.collections.ManageableHashSet for an example.
It is a HashSet that implements the ManageableCollection interface.

Are you willing to share your Map class? I'd love to add more user 
defined ManageableCollections to the util.collections package.

cheers,
Thomas

> Anyone has come across this before? Any hints appreciated
> 
> Thanks,
> 
> 
> 
> Saman Ghodsian
> CTO
> Middle Earth Technologies Ltd.
> www.metca.com
> Cell (604)-839-7791
> Vancouver, BC
> Canada
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
>