Package jsonvalues.gen
Class JsDoubleGen
- java.lang.Object
-
- jsonvalues.gen.JsDoubleGen
-
public final class JsDoubleGen extends Object implements fun.gen.Gen<JsDouble>
Represents a JsDouble generator. It can be created using the static factory methodsbiased
andarbitrary
or, if none of the previous suit your needs, from a double generator and the function map:import fun.gen.Gen; import jsonvalues.JsDouble; Gen<Double> doubleGen = seed -> () -> {...}; Gen<JsDouble> jsDoubleGen = gen.map(JsDouble::of)
Arbitrary generators produces uniformed distributions of values. Biased generators produces, with higher probability, potential problematic values that usually cause more bugs.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Supplier<JsDouble>
apply(Random seed)
Returns a supplier from the specified seed that generates a new JsDouble each time it's calledstatic fun.gen.Gen<JsDouble>
arbitrary()
Returns a generator that produces values uniformly distributedstatic fun.gen.Gen<JsDouble>
arbitrary(double min, double max)
Returns a generator that produces values uniformly distributed over a specified intervalstatic fun.gen.Gen<JsDouble>
biased()
returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs.static fun.gen.Gen<JsDouble>
biased(double min, double max)
returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs.
-
-
-
Method Detail
-
biased
public static fun.gen.Gen<JsDouble> biased()
returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs. These values are:-
Long.MIN_VALUE
-Integer.MIN_VALUE
-Short.MIN_VALUE
-Byte.MIN_VALUE
- 0 -Long.MAX_VALUE
-Integer.MAX_VALUE
-Short.MAX_VALUE
-Byte.MAX_VALUE
- Returns:
- a biased JsDouble generator
-
arbitrary
public static fun.gen.Gen<JsDouble> arbitrary()
Returns a generator that produces values uniformly distributed- Returns:
- a JsDouble generator
-
biased
public static fun.gen.Gen<JsDouble> biased(double min, double max)
returns a biased generators that produces, with higher probability, potential problematic values that usually cause more bugs. These values are:- the lower bound of the interval - the upper bound of the interval
and the following numbers provided that they are between the specified interval:-
Long.MIN_VALUE
-Integer.MIN_VALUE
-Short.MIN_VALUE
-Byte.MIN_VALUE
- 0 -Integer.MAX_VALUE
-Short.MAX_VALUE
-Byte.MAX_VALUE
-Long.MAX_VALUE
- Parameters:
min
- lower bound of the interval (inclusive)max
- upper bound of the interval (inclusive)- Returns:
- a biased JsDouble generator
-
arbitrary
public static fun.gen.Gen<JsDouble> arbitrary(double min, double max)
Returns a generator that produces values uniformly distributed over a specified interval- Parameters:
min
- lower bound of the interval (inclusive)max
- upper bound of the interval (inclusive)- Returns:
- a biased JsDouble generator
-
-