Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: How to implement CompositeMap class structure in java which is available in the Jakarta Apache Commons Collections?

  1. #1
    Junior Member
    Join Date
    May 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to implement CompositeMap class structure in java which is available in the Jakarta Apache Commons Collections?

    DataMap is a class structure that maps a single key to multiple values.

    I'm supposed to design a class structure called JoinMap which keeps a pair of keys of two DataMaps.

    As far as I understood, a JoinMap is meant to join data from two DataMaps into a single view. It somehow reminds of the CompositeMap class structure available in the Jakarta Apache Commons Collections.

    Any idea how I should implement this ? Does anyone know how a CompositeMap actually works? Any idea would be appreciated. Thanks.


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 286 Times in 225 Posts
    Blog Entries
    4

    Default Re: JoinMap

    Hello gatekeeper, welcome to the forums.

    Sorry for the late reply but it doesn't look like anyone has had any experience with CompositeMap before.

    Does this link help you?

    Java Doc for CompositeMap
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

  3. #3
    Junior Member
    Join Date
    May 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JoinMap

    hello,
    I am not sure whether you need a compositeMap or not...all you need is a data structure with a key that would map to the pair of keys of your two other maps..is this correct?
    If this is it, then there are many ways to do this...you can define a map which contains keys that points to pairs of keys.
    There are other ways..but if you want to stick with maps, this might work for you.