Interface DiscreteSampler
-
- All Known Subinterfaces:
SharedStateDiscreteSampler
- All Known Implementing Classes:
AliasMethodDiscreteSampler
,DiscreteUniformSampler
,FastLoadedDiceRollerDiscreteSampler
,GuideTableDiscreteSampler
,InverseTransformDiscreteSampler
,KempSmallMeanPoissonSampler
,LargeMeanPoissonSampler
,PoissonSampler
,RejectionInversionZipfSampler
,SmallMeanPoissonSampler
public interface DiscreteSampler
Sampler that generates values of typeint
.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
sample()
Creates anint
sample.default IntStream
samples()
Returns an effectively unlimited stream ofint
sample values.default IntStream
samples(long streamSize)
Returns a stream producing the givenstreamSize
number ofint
sample values.
-
-
-
Method Detail
-
sample
int sample()
Creates anint
sample.- Returns:
- a sample.
-
samples
default IntStream samples()
Returns an effectively unlimited stream ofint
sample values.The default implementation produces a sequential stream that repeatedly calls
sample
().- Returns:
- a stream of
int
values. - Since:
- 1.5
-
samples
default IntStream samples(long streamSize)
Returns a stream producing the givenstreamSize
number ofint
sample values.The default implementation produces a sequential stream that repeatedly calls
sample
(); the stream is limited to the givenstreamSize
.- Parameters:
streamSize
- Number of values to generate.- Returns:
- a stream of
int
values. - Since:
- 1.5
-
-