Google Groups Home
Help | Sign in
ListMultimap#asMap
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Nick Partridge  
View profile
 More options Apr 6, 8:58 pm
From: Nick Partridge <nkp...@gmail.com>
Date: Sun, 6 Apr 2008 17:58:08 -0700 (PDT)
Local: Sun, Apr 6 2008 8:58 pm
Subject: ListMultimap#asMap
Hey,

Is it possible that asMap() for a ListMultimap could be changed to
return a Map<K, List<V>>, rather than the Map<K, Collection<V>> that
it returns now? It seems a bit inconsistent with the behaviour of get
(which does return a List).

Thanks,
Nick Partridge


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kevin bourrillion  
View profile
 More options Apr 8, 5:29 pm
From: "kevin bourrillion" <kev...@google.com>
Date: Tue, 8 Apr 2008 14:29:34 -0700
Local: Tues, Apr 8 2008 5:29 pm
Subject: Re: [google-collections] ListMultimap#asMap

In order for this override to be possible, Multimap.asMap() must be defined
to return Map<K, ? extends Collection<V>>, and ListMultimap.asMap() Map<K, ?
extends List<V>>.

But wildcards in return types of methods == user sadness.  You have to push
that "? extends" all throughout your own code.

Jared made this change once, and thankfully saw the damage it did to user
code and backed out.

On Sun, Apr 6, 2008 at 5:58 PM, Nick Partridge <nkp...@gmail.com> wrote:

> Hey,

> Is it possible that asMap() for a ListMultimap could be changed to
> return a Map<K, List<V>>, rather than the Map<K, Collection<V>> that
> it returns now? It seems a bit inconsistent with the behaviour of get
> (which does return a List).

> Thanks,
> Nick Partridge

--
Kevin Bourrillion @ Google
internal: go/javalibraries
google-collections.googlecode.com
google-guice.googlecode.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Partridge  
View profile
 More options Apr 9, 1:24 am
From: "Nick Partridge" <nkp...@gmail.com>
Date: Wed, 9 Apr 2008 15:24:03 +1000
Local: Wed, Apr 9 2008 1:24 am
Subject: Re: [google-collections] ListMultimap#asMap
Ah right, I hadn't considered that. Thanks :)
-Nick


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google