commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v2cg4ss <ssel...@datamentors.com>
Subject MultiValueMap and Generics
Date Fri, 29 Aug 2008 18:39:33 GMT

I have the following code, is there away to traverse the MVM without using
Iterator's and using the Types of the content of the TreeMap.  I've tried in
Eclipse and it flags the code with type safety warnings and errors.

MultiValueMap mvm = MultiValueMap.decorate(new TreeMap<Integer, String>());

Set<?> keys = mvm.keySet();
Iterator<?> it = keys.iterator();
Collection<?> collect = null;
Iterator<?> collectIT = null;
                     
while (it.hasNext())
{
  key = (MutableString)it.next();
  System.out.println(key);
                        
  collect = mvm.getCollection(key);
  if (collect != null)
  {
     collectIT = collect.iterator();
     while (collectIT.hasNext())
     {
        System.out.println((char[])collectIT.next());
     }
  }
}


Thanks

-- 
View this message in context: http://www.nabble.com/MultiValueMap-and-Generics-tp19224975p19224975.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message