Re: question



Daniel Moyne wrote:
Now regarding you proposal which is neat though it does not allow for the
ArrayList [sic] to be used in another method of the class as actually required in
my work ; the example provided here was only meant to understand the way
the put action was working regarding the list value of the map with
different options ; of couse the Map created in sued in another method in
my work.

Since the ArrayLists (plural!) are in the Map, you retrieve them from the Map. The variable in question will not be in scope in another method anyway, so your reasoning is not applicable. It also will hold only /one/ of the Lists; how do you figure on retrieving the others?

And you haven't answered why the map is
Map <Integer, ArrayList <<String>>
instead of
Map <Integer, List <Integer>>
.. Why is it so necessary to store Strings in the List, and ArrayLists in the Map?

--
Lew

.



Relevant Pages

  • Re: question
    ... the map with different options; of couse the Map created in sued in ... Since the ArrayLists are in the Map, ... strings in a text file line by line; ... when I read the file I store the strings in an ArrayList and this ...
    (comp.lang.java.help)
  • Re: question
    ... Why is it so necessary to store Strings in the List, and ArrayLists in ... strings in a text file line by line; ... ArrayList as the value of the map record with the line number as the key. ...
    (comp.lang.java.help)
  • Re: question
    ... Why is it so necessary to store Strings in the List, and ArrayLists ... Daniel Moyne wrote: ... ArrayList and this ArrayList as the value of the map record with the line ...
    (comp.lang.java.help)
  • Re: Perl Performance Tuning
    ... >> choosing for vs map is more than just speed. ... even with shorter lists, there are times where map will take ... win over calling push inside a for (the push is more perl ops than the ... >> fix bugs when they were used outside their very tiny design envelope. ...
    (comp.lang.perl.misc)
  • Re: Perl Performance Tuning
    ... >> choosing for vs map is more than just speed. ... even with shorter lists, there are times where map will take ... longer than the equivilent explicit for/push loop (which is really what ... win over calling push inside a for (the push is more perl ops than the ...
    (comp.lang.perl.misc)