MCPcopy Create free account
hub / github.com/antlr/codebuff / immutableSortedCopy

Method immutableSortedCopy

output/java_guava/1.4.17/Ordering.java:905–914  ·  view source on GitHub ↗

Returns an immutable list containing elements sorted by this ordering. The input is not modified. Unlike Sets#newTreeSet(Iterable), this method does not discard elements that are duplicates according to the comparator. The sort performed is stable , meaning that such

(Iterable<E> elements)

Source from the content-addressed store, hash-verified

903 */
904
905 @CanIgnoreReturnValue // TODO(kak): Consider removing this
906 public <E extends T> ImmutableList<E> immutableSortedCopy(Iterable<E> elements) {
907 @SuppressWarnings("unchecked") // we'll only ever have E's in here
908 E[] array = (E[]) Iterables.toArray(elements);
909 for (E e : array) {
910 checkNotNull(e);
911 }
912 Arrays.sort(array, this);
913 return ImmutableList.asImmutableList(array);
914 }
915
916 /**
917 * Returns {@code true} if each element in {@code iterable} after the first is

Callers 7

sortKeysByValueMethod · 0.95
buildMethod · 0.45
toSortedListMethod · 0.45
buildMethod · 0.45
copyHighestCountFirstMethod · 0.45
forCellsInternalMethod · 0.45

Calls 4

toArrayMethod · 0.95
asImmutableListMethod · 0.95
sortMethod · 0.80
checkNotNullMethod · 0.45

Tested by

no test coverage detected