Top Methods
io.vavr.test

pack-priv Interface GenModule

Located in compilation unit of io.vavr.test.Gen.


Method Summary

Modifier and TypeMethod and Description
public static <
type of generated values
T
>
Gen<T>

Returns:

A value generator, choosen according to the given frequencies and the underlying n
frequency
(int
a random value between 0 and sum(frequencies) - 1
n
,
Iterator<Tuple2<Integer, Gen<T>>>
a non-empty Iterator of (frequency, Gen) pairs
iter
)

Chooses a Gen according to the given frequencies.

Method Detail

frequencyback to summary
public static <T> Gen<T> frequency(int n, Iterator<Tuple2<Integer, Gen<T>>> iter)

Chooses a Gen according to the given frequencies.

Parameters
<T>
type of generated values
n:int

a random value between 0 and sum(frequencies) - 1

iter:Iterator<Tuple2<Integer, Gen<T>>>

a non-empty Iterator of (frequency, Gen) pairs

Returns:Gen<T>

A value generator, choosen according to the given frequencies and the underlying n