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


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

Re: Generics for a multiplevalue hashmap

Date 2011-07-21 17:15 -0400
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Generics for a multiplevalue hashmap
References <295b693a-1ba9-454f-965b-d33fc4d43731@glegroupsg2000goo.googlegroups.com>
Message-ID <4e2896da$0$309$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 7/19/2011 4:32 PM, Richard wrote:
> I have done this
>
> public class MultipleValueHashMap<T, U>   implements Map<T, java.util.List<U>>  {
>
> I want to implement Map rather than extend HashMap as per Josh Bloch's Effective Java item 16. http://java.sun.com/docs/books/effective/toc.html
>
> So I do not want to do this.
> public class MM2<T,U>  extends HashMap<T, List<U>>   {
> }


Note the word "favor".

You should evaluate not just choose without thinking.

Arne

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


Thread

Re: Generics for a multiplevalue hashmap Richard <iamrichardjones@gmail.com> - 2011-07-19 13:32 -0700
  Re: Generics for a multiplevalue hashmap Arne Vajhøj <arne@vajhoej.dk> - 2011-07-21 17:15 -0400
    Re: Generics for a multiplevalue hashmap lewbloch <lewbloch@gmail.com> - 2011-07-21 15:30 -0700

csiph-web