public class EnumeratedDistribution.Sampler extends Object
| Modifier and Type | Method | Description |
|---|---|---|
T |
sample() |
Generates a random value sampled from this distribution.
|
Object[] |
sample(int sampleSize) |
Generates a random sample from the distribution.
|
T[] |
sample(int sampleSize,
T[] array) |
Generates a random sample from the distribution.
|
public T sample()
public Object[] sample(int sampleSize) throws NotStrictlyPositiveException
sampleSize - the number of random values to generate.NotStrictlyPositiveException - if sampleSize is not
positive.public T[] sample(int sampleSize, T[] array) throws NotStrictlyPositiveException
If the requested samples fit in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this collection.
sampleSize - the number of random values to generate.array - the array to populate.NotStrictlyPositiveException - if sampleSize is not positive.NullArgumentException - if array is nullCopyright © 2003–2017 The Apache Software Foundation. All rights reserved.