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 intsample()Creates anintsample.default IntStreamsamples()Returns an effectively unlimited stream ofintsample values.default IntStreamsamples(long streamSize)Returns a stream producing the givenstreamSizenumber ofintsample values.
-
-
-
Method Detail
-
sample
int sample()
Creates anintsample.- Returns:
- a sample.
-
samples
default IntStream samples()
Returns an effectively unlimited stream ofintsample values.The default implementation produces a sequential stream that repeatedly calls
sample().- Returns:
- a stream of
intvalues. - Since:
- 1.5
-
samples
default IntStream samples(long streamSize)
Returns a stream producing the givenstreamSizenumber ofintsample 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
intvalues. - Since:
- 1.5
-
-