Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #6266

Re: Generics for a multiplevalue hashmap

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: Generics for a multiplevalue hashmap
Date Mon, 18 Jul 2011 14:40:09 -0700
Organization A noiseless patient Spider
Lines 21
Message-ID <j0297q$vpe$1@dont-email.me> (permalink)
References <2f4c5543-ceef-4cdb-8ff7-b978f30766e0@glegroupsg2000goo.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Mon, 18 Jul 2011 21:40:11 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="32558"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Wt0wVRHDmKr8zBYJ8yymClGYnOb+ekvE="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0
In-Reply-To <2f4c5543-ceef-4cdb-8ff7-b978f30766e0@glegroupsg2000goo.googlegroups.com>
Cancel-Lock sha1:o3WqQSmCS9s7C1qI2TvLkumLIn8=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6266

Show key headers only | View raw


On 7/18/2011 2:31 PM, Alexis Berry wrote:

> Unfortunately this does not compile. I think it might be because I am
> mixing generic types with real types. Am I correct?


Sort of.  You can't put constraints on the parameter type the way you 
are thinking.


 > public class MultipleValueHashMap<T, java.util.List<U>>  implements
 > Map<T, java.util.List<U>>  {


Should be:

   public class MultipleValueHashMap<T, U>  implements
   Map<T, java.util.List<U>>  {

I think.  I'll check it in a sec and post again if it needs correcting.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Generics for a multiplevalue hashmap Alexis Berry <iamrichardjones@gmail.com> - 2011-07-18 14:31 -0700
  Re: Generics for a multiplevalue hashmap markspace <-@.> - 2011-07-18 14:40 -0700
  Re: Generics for a multiplevalue hashmap Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-07-18 21:00 -0300
  Re: Generics for a multiplevalue hashmap Arne Vajhøj <arne@vajhoej.dk> - 2011-07-18 23:01 -0400
  Re: Generics for a multiplevalue hashmap Roedy Green <see_website@mindprod.com.invalid> - 2011-07-19 03:59 -0700
  Re: Generics for a multiplevalue hashmap Esmond Pitt <esmond.pitt@bigpond.com> - 2011-07-19 22:24 +1000
    Re: Generics for a multiplevalue hashmap markspace <-@.> - 2011-07-19 08:31 -0700

csiph-web