public final class JsIntGen extends Object implements fun.gen.Gen<JsInt>
biased
and arbitrary
or, if none of the previous suit your
needs, from an integer generator and the function map:
import fun.gen.Gen;
import jsonvalues.JsInt;
Gen<Integer> intGen = seed -> () -> {...};
Gen<JsInteger> jsIntGen = gen.map(JsInt::of)
Arbitrary generators produces uniformed distributions of values. Biased generators produces, with higher probability, potential problematic values that usually cause more bugs.
Modifier and Type | Method and Description |
---|---|
Supplier<JsInt> |
apply(Random seed)
Returns a supplier from the specified seed that generates a new JsInt each time it's called
|
static fun.gen.Gen<JsInt> |
arbitrary()
Returns a generator that produces values uniformly distributed
|
static fun.gen.Gen<JsInt> |
arbitrary(int min,
int max)
Returns a generator that produces values uniformly distributed over a specified interval
|
static fun.gen.Gen<JsInt> |
biased()
returns a biased generators that produces, with higher probability, potential problematic values
that usually cause more bugs.
|
static fun.gen.Gen<JsInt> |
biased(int min,
int max)
returns a biased generators that produces, with higher probability, potential problematic values
that usually cause more bugs.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static fun.gen.Gen<JsInt> biased()
-Integer.MIN_VALUE
-Short.MIN_VALUE
-Byte.MIN_VALUE
- 0 -Integer.MAX_VALUE
-Short.MAX_VALUE
-Byte.MAX_VALUE
public static fun.gen.Gen<JsInt> arbitrary()
public static fun.gen.Gen<JsInt> arbitrary(int min, int max)
min
- lower bound of the interval (inclusive)max
- upper bound of the interval (inclusive)public static fun.gen.Gen<JsInt> biased(int min, int max)
- the lower bound of the interval - the upper bound of the intervaland the following numbers provided that they are between the specified interval:
-Integer.MIN_VALUE
-Short.MIN_VALUE
-Byte.MIN_VALUE
- 0 -Integer.MAX_VALUE
-Short.MAX_VALUE
-Byte.MAX_VALUE
min
- lower bound of the interval (inclusive)max
- upper bound of the interval (inclusive)Copyright © 2022. All rights reserved.