Java Array Shuffle shuffle(Collection items, Random random)

Here you can find the source of shuffle(Collection items, Random random)

Description

shuffle

License

Open Source License

Declaration

public static <T> List<T> shuffle(Collection<T> items, Random random) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import java.util.List;

import java.util.Random;

public class Main {
    public static <T> List<T> shuffle(Collection<T> items, Random random) {
        List<T> result = new ArrayList<T>(items);
        Collections.shuffle(result, random);
        return result;
    }/*ww w . ja  va 2s .  com*/
}

Related

  1. randomize(final T[] array)
  2. shuffle()
  3. shuffle(byte[] array)
  4. shuffle(byte[] values, Random rnd)
  5. shuffle(Collection objects)
  6. shuffle(double[] arr, Random rnd)
  7. Shuffle(double[] array)
  8. shuffle(double[] array, Random r)