Into (original) (raw)
Doug Lea dl at cs.oswego.edu
Wed Dec 26 08:01:15 PST 2012
- Previous message: Into
- Next message: Into
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/26/12 10:51, Raab, Donald wrote:
Just to clarify, if these methods are added to Stream, we won't have any conflicts, as our methods appear on our Collections. But I think it might still be good to clarify the names.
Sure. In the unlikely event that Brian agrees about going this route :-), the names are up for grabs. I listed them this way because we find that people don't like the name "Navigable" (because it does not immediately imply sortedness in people's minds) so the less often you are forced to use it the better. But that's a minor concern.
(Note that several method names don't exactly match up with return type names. There's no j.u. name for List & RandomAccess, or for a Collection that is not necessarily a List but unlike Set permits duplicates. (Further aside: If there were, then Map.values() should use it as well, but too late for that.))
-Doug
-----Original Message----- From: Raab, Donald [Tech] Sent: Wednesday, December 26, 2012 10:47 AM To: 'Doug Lea'; 'lambda-libs-spec-experts at openjdk.java.net' Subject: RE: Into
We have methods to toSortedSet() and toSortedMap() that return SortedSet and SortedMap (as the names imply). We remain compatible back to Java 5, where NavigableSet and NavigableMap do not exist. I would request either calling the methods toNavigableSet()/toNavigableMap() and returning NavigableSet/NavigableMap or having both toSorted and toNavigable forms and returning the appropriately named types.
Object[] toArray(); Set toSet(); List toList(); List toRandomAccessList(); List toSortedList(Comparator<? super T> comparator); List toSortedList(); NavigableSet toSortedSet(); NavigableSet toSortedSet(Comparator<? super T> comparator); Collection toBag(); // unordered, possible dups Map<K,T> toMap(Function<? super T,K> keyFn, BinaryOperator mergeFn); Map<K,<Collection> toMap(Function<? super T,K> keyFn); NavigableMap<K,T> toSortedMap(Function<? super T,K> keyFn, Comparator<? super K> comparator, BinaryOperator mergeFn); NavigableMap<K,Collection> toSortedMap(Function<? super_ _T,K> keyFn, Comparator<? super_ _K> comparator);
- Previous message: Into
- Next message: Into
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-experts mailing list