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 theRandomdelegate 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 bytenextByte(byte min, byte max)charnextChar(char min, char max)intnextInt(int min, int max)longnextLong(long min, long max)shortnextShort(short min, short max)RandomtoJDKRandom()-
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:
toJDKRandomin classSourceOfRandomness
-
nextByte
public byte nextByte(byte min, byte max)- Overrides:
nextBytein classSourceOfRandomness
-
nextShort
public short nextShort(short min, short max)- Overrides:
nextShortin classSourceOfRandomness
-
nextChar
public char nextChar(char min, char max)- Overrides:
nextCharin classSourceOfRandomness
-
nextInt
public int nextInt(int min, int max)- Overrides:
nextIntin classSourceOfRandomness
-
nextLong
public long nextLong(long min, long max)- Overrides:
nextLongin classSourceOfRandomness
-
-