Into
Raab, Donald
Donald.Raab at gs.com
Wed Dec 26 07:46:43 PST 2012
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<T> toSet();
> List<T> toList();
> List<T> toRandomAccessList();
> List<T> toSortedList(Comparator<? super T> comparator);
> List<T> toSortedList();
> NavigableSet<T> toSortedSet();
> NavigableSet<T> toSortedSet(Comparator<? super T> comparator);
> Collection<T> toBag(); // unordered, possible dups
> <K> Map<K,T> toMap(Function<? super T,K> keyFn, BinaryOperator<T>
> mergeFn);
> <K> Map<K,<Collection<T>> toMap(Function<? super T,K> keyFn);
> <K> NavigableMap<K,T> toSortedMap(Function<? super T,K> keyFn,
> Comparator<? super K> comparator,
> BinaryOperator<T> mergeFn);
> <K> NavigableMap<K,Collection<T>> toSortedMap(Function<? super T,K>
> keyFn,
> Comparator<? super K>
> comparator);
More information about the lambda-libs-spec-observers
mailing list