Class FastSourceOfRandomness
- java.lang.Object
-
- com.pholser.junit.quickcheck.random.SourceOfRandomness
-
- edu.berkeley.cs.jqf.fuzz.junit.quickcheck.FastSourceOfRandomness
-
public class FastSourceOfRandomness extends SourceOfRandomness
A source of randomness with better performance but looser statistical guarantees. This class is meant for use with guided fuzzing, where theRandom
delegate is usually aStreamBackedRandom
. In this case, the random source does not have to give any statistical guarantees such as uniformity or independentness, and therefore is amenable to several optimizations, which are implemented in this class.- Author:
- Rohan Padhye
-
-
Constructor Summary
Constructors Constructor Description FastSourceOfRandomness(StreamBackedRandom delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
nextByte(byte min, byte max)
char
nextChar(char min, char max)
int
nextInt(int min, int max)
long
nextLong(long min, long max)
short
nextShort(short min, short max)
Random
toJDKRandom()
-
Methods inherited from class com.pholser.junit.quickcheck.random.SourceOfRandomness
choose, choose, delegate, nextBigInteger, nextBoolean, nextBytes, nextBytes, nextDouble, nextDouble, nextDuration, nextFloat, nextFloat, nextGaussian, nextInstant, nextInt, nextInt, nextLong, seed, setSeed
-
-
-
-
Constructor Detail
-
FastSourceOfRandomness
public FastSourceOfRandomness(StreamBackedRandom delegate)
-
-
Method Detail
-
toJDKRandom
public Random toJDKRandom()
- Overrides:
toJDKRandom
in classSourceOfRandomness
-
nextByte
public byte nextByte(byte min, byte max)
- Overrides:
nextByte
in classSourceOfRandomness
-
nextShort
public short nextShort(short min, short max)
- Overrides:
nextShort
in classSourceOfRandomness
-
nextChar
public char nextChar(char min, char max)
- Overrides:
nextChar
in classSourceOfRandomness
-
nextInt
public int nextInt(int min, int max)
- Overrides:
nextInt
in classSourceOfRandomness
-
nextLong
public long nextLong(long min, long max)
- Overrides:
nextLong
in classSourceOfRandomness
-
-