Package org.apache.commons.rng.sampling
Interface ObjectSampler<T>
-
- Type Parameters:
T
- Type of the sample.
- All Known Subinterfaces:
SharedStateObjectSampler<T>
- All Known Implementing Classes:
BoxSampler
,CollectionSampler
,CombinationSampler
,DirichletSampler
,DiscreteProbabilityCollectionSampler
,LineSampler
,PermutationSampler
,TetrahedronSampler
,TriangleSampler
,UnitBallSampler
,UnitSphereSampler
public interface ObjectSampler<T>
Sampler that generates values of a specified type.- Since:
- 1.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description T
sample()
Create an object sample.default Stream<T>
samples()
Returns an effectively unlimited stream of object sample values.default Stream<T>
samples(long streamSize)
Returns a stream producing the givenstreamSize
number of object sample values.
-
-
-
Method Detail
-
samples
default Stream<T> samples()
Returns an effectively unlimited stream of object sample values.The default implementation produces a sequential stream that repeatedly calls
sample
().- Returns:
- a stream of object values.
- Since:
- 1.5
-
samples
default Stream<T> samples(long streamSize)
Returns a stream producing the givenstreamSize
number of object 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 object values.
- Since:
- 1.5
-
-