It just testing-code and does not make much sense. but here we go.
I had a list before .. so the map is constructed from the list.
--- code ---
public static List<String> countryCodes = new ArrayList<String>(
Arrays.asList(
"de", "en", "it"
));
public static Map<String,String> countryMap = null;
public static Map getCountryMap() {
if (countryMap == null) {
countryMap = new HashMap<String,String>();
for (String s : countryCodes) {
countryMap.put(s,s);
}
}
return countryMap;
}
--- code ---
Am Donnerstag, 15. März 2007 schrieb Dave Newton:
> --- Piero Sartini <[EMAIL PROTECTED]> wrote:
> > Am Donnerstag, 15. März 2007 schrieb Dave Newton:
> > > --- Piero Sartini wrote:
> > > > return Constants.getCountryMap();
> > >
> > > What does Constants.getCountryMap() return?
> >
> > the map looks like:
> > {de=de, it=it, en=en}
>
> No, I want the actual code for the map's construction
> and retrieval method, because so far I have no idea
> why it wouldn't work.
>
> d.
>
>
>
>
> ___________________________________________________________________________
>_________ TV dinner still cooling?
> Check out "Tonight's Picks" on Yahoo! TV.
> http://tv.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]