list of maps
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: list of maps

  1. #1
    Join Date
    Jul 2007

    list of maps

    I have an objects Var {String type, String identifier } and I need to associato it to an Integer; so I used a Map for this.
    Then, I must keep many of those Map and so I used this:
    public List< Map<Var,Integer> > mapping = new ArrayList< Map<Var,Integer> >();
    1. how declare LinkedHashMap instead just a Map in the right side? The compiler gets an error with that;
    2. is it a right thing? It seems to me a very complicated way a 'list of maps'; any alternatives?

  2. #2
    Join Date
    Feb 2008

    Re: list of maps

    Can you post the error message that the compiler gives you? I am willing to be it is because you have not added the correct import statement for the LinkedHashMap.

    As far as 2 goes, if you want a List of Maps, how else would you expect to see it? What seems complicated about this way of doing it? You are indicating that you have a list. In this list the elements will be maps. The maps will contain a Var as a key, and an Integer as the value. Pretty straight forward if you ask me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

HTML5 Development Center