Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to store this (key1,key2, Object) ?

Reply
Thread Tools

How to store this (key1,key2, Object) ?

 
 
exquisitus
Guest
Posts: n/a
 
      05-04-2005
Is there a data type in the JDK (1.4) that allows me to do this (and
also retieve) or do I have to roll my own?

tks

 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      05-04-2005

On 04.05.2005 17:13 exquisitus wrote:

> Is there a data type in the JDK (1.4) that allows me to do this (and
> also retieve) or do I have to roll my own?
>
> tks
>


What about storing (key1 + "<delimiter>" + key2, Object)

Thomas
 
Reply With Quote
 
 
 
 
Roland
Guest
Posts: n/a
 
      05-04-2005
On 4-5-2005 17:13, exquisitus wrote:
> Is there a data type in the JDK (1.4) that allows me to do this (and
> also retieve) or do I have to roll my own?
>
> tks
>

No and No.
You could use Apache Commons Collections' MultiKeyMap
<http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_1/org/apache/commons/collections/map/MultiKeyMap.html>
<http://jakarta.apache.org/commons/collections/>
--
Regards,

Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
 
Reply With Quote
 
exquisitus
Guest
Posts: n/a
 
      05-04-2005
Thanks Roland. Can I use the MultikeyMap in a session EJB?


Roland wrote:

> On 4-5-2005 17:13, exquisitus wrote:
>
>> Is there a data type in the JDK (1.4) that allows me to do this (and
>> also retieve) or do I have to roll my own?
>>
>> tks
>>

> No and No.
> You could use Apache Commons Collections' MultiKeyMap
> <http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_1/org/apache/commons/collections/map/MultiKeyMap.html>
>
> <http://jakarta.apache.org/commons/collections/>


 
Reply With Quote
 
exquisitus
Guest
Posts: n/a
 
      05-04-2005
Thanks Thomas, this is probably the simplest way to do what I want to do

Thomas Kellerer wrote:

> On 04.05.2005 17:13 exquisitus wrote:
>
>
>>Is there a data type in the JDK (1.4) that allows me to do this (and
>>also retieve) or do I have to roll my own?
>>
>>tks
>>

>
>
> What about storing (key1 + "<delimiter>" + key2, Object)
>
> Thomas


 
Reply With Quote
 
Roland
Guest
Posts: n/a
 
      05-04-2005
On 4-5-2005 17:40, exquisitus wrote:

> Roland wrote:
>
>> On 4-5-2005 17:13, exquisitus wrote:
>>
>>> Is there a data type in the JDK (1.4) that allows me to do this (and
>>> also retieve) or do I have to roll my own?
>>>
>>> tks
>>>

>> No and No.
>> You could use Apache Commons Collections' MultiKeyMap
>> <http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_1/org/apache/commons/collections/map/MultiKeyMap.html>
>>
>> <http://jakarta.apache.org/commons/collections/>

>
>
> Thanks Roland. Can I use the MultikeyMap in a session EJB?
>
>

Yes, if you deploy the jar with the Commons Collections to your J2EE
server and if MultiKeyMap is serializable (let me check... yes it
implements java.io.Serializable) and all keys/items you store in the map
are too, then I wouldn't know a reason why you couldn't.
--
Regards,

Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
 
Reply With Quote
 
exquisitus
Guest
Posts: n/a
 
      05-04-2005
Thanks Roland, I appreciate your quick response. Very helpful

Roland wrote:

> On 4-5-2005 17:40, exquisitus wrote:
>
>> Roland wrote:
>>
>>> On 4-5-2005 17:13, exquisitus wrote:
>>>
>>>> Is there a data type in the JDK (1.4) that allows me to do this (and
>>>> also retieve) or do I have to roll my own?
>>>>
>>>> tks
>>>>
>>> No and No.
>>> You could use Apache Commons Collections' MultiKeyMap
>>> <http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_1/org/apache/commons/collections/map/MultiKeyMap.html>
>>>
>>> <http://jakarta.apache.org/commons/collections/>

>>
>>
>>
>> Thanks Roland. Can I use the MultikeyMap in a session EJB?
>>
>>

> Yes, if you deploy the jar with the Commons Collections to your J2EE
> server and if MultiKeyMap is serializable (let me check... yes it
> implements java.io.Serializable) and all keys/items you store in the map
> are too, then I wouldn't know a reason why you couldn't.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
64-bit Sempron now in store! Silverstrand Front Page News 0 06-24-2005 09:32 PM
to store or not to store an image =?Utf-8?B?UnVkeQ==?= ASP .Net 6 03-30-2005 05:51 AM
Where does thubderbird 1.0 store email? Keith Firefox 7 12-31-2004 05:44 AM
user & password store and autofill so what is Clemens Li Firefox 1 12-17-2004 10:56 AM
Re: How to store the profile in a place different from C:\Documentsand howdeedoo@utter.pla.net Firefox 0 04-23-2004 10:02 PM



Advertisments