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

Discussion in 'Java' started by exquisitus, May 4, 2005.

  1. exquisitus

    exquisitus Guest

    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
    exquisitus, May 4, 2005
    #1
    1. Advertising

  2. 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
    Thomas Kellerer, May 4, 2005
    #2
    1. Advertising

  3. exquisitus

    Roland Guest

    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_/ /__/
    / \ /_/ / \
    Roland, May 4, 2005
    #3
  4. exquisitus

    exquisitus Guest

    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/>
    exquisitus, May 4, 2005
    #4
  5. exquisitus

    exquisitus Guest

    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
    exquisitus, May 4, 2005
    #5
  6. exquisitus

    Roland Guest

    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_/ /__/
    / \ /_/ / \
    Roland, May 4, 2005
    #6
  7. exquisitus

    exquisitus Guest

    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.
    exquisitus, May 4, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Geert M
    Replies:
    2
    Views:
    323
    Geert M
    Nov 19, 2003
  2. Alex
    Replies:
    3
    Views:
    1,477
    Alvin Bruney
    Dec 2, 2003
  3. RSB
    Replies:
    3
    Views:
    4,330
    Steve C. Orr [MVP, MCSD]
    Jul 21, 2004
  4. =?Utf-8?B?UnVkeQ==?=

    to store or not to store an image

    =?Utf-8?B?UnVkeQ==?=, Mar 29, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    617
    =?Utf-8?B?UnVkeQ==?=
    Mar 30, 2005
  5. JJA
    Replies:
    0
    Views:
    145
Loading...

Share This Page