|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcheck.generator.NullGen<T>
public class NullGen<T>
Generate null
instead of objects with a given probability.
Constructor Summary | |
---|---|
NullGen(Gen<T> generator,
double probability)
Construct a generator that will generate null with the
supplied probability instead of objects from the given generator. |
Method Summary | |
---|---|
T |
arbitrary(java.util.Random random,
long size)
Returns an arbitrary object of type T. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NullGen(Gen<T> generator, double probability)
null
with the
supplied probability instead of objects from the given generator.
generator
- generator for objectsprobability
- probability that the object will be null instead of an object from the given generatorMethod Detail |
---|
public T arbitrary(java.util.Random random, long size)
Gen
Returns an arbitrary object of type T. The object should not have a size greater than size (or smaller than -size). What the size actually referrs to depends on the implementation, but it could be the number of nodes in a tree, pixels in an image etc.
The supplied random generator should be the only source of randomness used in the generator.
arbitrary
in interface Gen<T>
random
- the random generator that should be used when randomness is needed.size
- the limiting factor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |