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

Method permutations

output/java_guava/1.4.16/Collections2.java:562–565  ·  view source on GitHub ↗

Returns a Collection of all the permutations of the specified Collection. Notes: This is an implementation of the Plain Changes algorithm for permutations generation, described in Knuth's "The Art of Computer Programming", Volume 4, Chapter 7, Section 7.2.1.2. If the i

(Collection<E> elements)

Source from the content-addressed store, hash-verified

560 */
561
562 @Beta
563 public static <E> Collection<List<E>> permutations(Collection<E> elements) {
564 return new PermutationCollection<E>(ImmutableList.copyOf(elements));
565 }
566
567 private static final class PermutationCollection<E> extends AbstractCollection<List<E>> {
568 final ImmutableList<E> inputList;

Callers

nothing calls this directly

Calls 1

copyOfMethod · 0.95

Tested by

no test coverage detected