org.jcheck.generator
Interface Gen<T>

All Known Implementing Classes:
ArrayGen, BigDecimalGen, BigIntegerGen, BooleanGen, ByteGen, CharacterGen, DoubleGen, ElementGen, FloatGen, FrequencyGen, IntegerGen, LongGen, NullGen, OneOfGen, PercentageGen, ShortGen, StringGen

public interface Gen<T>

Interface for all generators.

Implementing classes must have a zero-argument constructor if it should be used directly in @Generator annotations.


Method Summary
 T arbitrary(java.util.Random random, long size)
           Returns an arbitrary object of type T.
 

Method Detail

arbitrary

T arbitrary(java.util.Random random,
            long size)

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.

Parameters:
random - the random generator that should be used when randomness is needed.
size - the limiting factor
Returns:
a random object