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 2 of 2

Thread: Convert Maps of String to Map of Maps

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

    Default Convert Maps of String to Map of Maps

    Input-
    Map<String,String> inputMap;
    The contents of the map are --
    {a,{A:0,B:2,C:1,D:0}}
    {b,{A:2,B:0,C:3}}

    Output

    Map<String,Map<String,Integer>>outputMap;
    The content of the output Map should contain

    {A,{{a,0},{b,2}}}
    {B,{{a,2},{b,0}}}
    {C,{{a,1},{b,3}}}
    {D,{{a,0}}}


  2. #2
    Member
    Join Date
    Oct 2009
    Posts
    52
    Thanks
    0
    Thanked 6 Times in 5 Posts

    Default Re: Convert Maps of String to Map of Maps

    This is a perfect opportunity for you to read the Java API for Maps and Strings ;-)

    The Java API: Java Platform SE 6
    Last edited by literallyjer; October 27th, 2009 at 07:32 AM.

Similar Threads

  1. Convert DOC,XLS to PDF with Java
    By comm in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: July 2nd, 2013, 04:10 AM
  2. Conversion of string into integer in Java
    By JavaPF in forum Java Programming Tutorials
    Replies: 17
    Last Post: January 23rd, 2010, 09:33 AM
  3. Convert Vector to Byte Array
    By perlWhite in forum Java Theory & Questions
    Replies: 0
    Last Post: August 25th, 2009, 05:45 AM
  4. convert GSM to PCM (wav)
    By cilang in forum Java Theory & Questions
    Replies: 4
    Last Post: August 7th, 2009, 03:46 AM
  5. convert arraylist to a hash map
    By nadman123 in forum Collections and Generics
    Replies: 1
    Last Post: July 29th, 2009, 04:24 AM