org.aksw.commons.collections.random
Class RandomUtils
java.lang.Object
org.aksw.commons.collections.random.RandomUtils
public class RandomUtils
- extends Object
Created by Claus Stadler
Date: Oct 9, 2010
Time: 5:43:50 PM
|
Method Summary |
static
|
randomItem(Collection<T> collection,
Random random)
|
static
|
randomItem(Iterable<T> iterable,
Random random)
|
static
|
randomSampleSet(Collection<T> source,
int sampleSize)
|
static
|
randomSampleSet(Collection<T> source,
int sampleSize,
Random random)
|
static
|
shuffleRandomSample(List<T> source,
Collection<T> out,
int sampleSize,
Random random)
Extracts a random sample of a specified maximum size from the given collection. |
static
|
shuffleRemoveRandomSample(List<T> source,
Collection<T> out,
int sampleSize,
Random random)
|
static
|
shuffleRemoveRandomSampleSet(List<T> source,
int sampleSize,
Random random)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomUtils
public RandomUtils()
shuffleRandomSample
public static <T> void shuffleRandomSample(List<T> source,
Collection<T> out,
int sampleSize,
Random random)
- Extracts a random sample of a specified maximum size from the given collection.
Warning: Shuffles elements of the source list.
- Type Parameters:
T - - Parameters:
source - sampleSize -
shuffleRemoveRandomSample
public static <T> void shuffleRemoveRandomSample(List<T> source,
Collection<T> out,
int sampleSize,
Random random)
randomSampleSet
public static <T> Set<T> randomSampleSet(Collection<T> source,
int sampleSize,
Random random)
randomSampleSet
public static <T> Set<T> randomSampleSet(Collection<T> source,
int sampleSize)
shuffleRemoveRandomSampleSet
public static <T> Set<T> shuffleRemoveRandomSampleSet(List<T> source,
int sampleSize,
Random random)
randomItem
public static <T> T randomItem(Collection<T> collection,
Random random)
randomItem
public static <T> T randomItem(Iterable<T> iterable,
Random random)
Copyright © 2011. All Rights Reserved.