JET

edu.utep.cs.jet.rat.gen
Class SimpleValueGenerator

java.lang.Object
  extended by edu.utep.cs.jet.rat.gen.SimpleValueGenerator
All Implemented Interfaces:
ValueGenerator
Direct Known Subclasses:
IncrementalValueGenerator

public class SimpleValueGenerator
extends Object
implements ValueGenerator

A class to generate various types of values randomly.

Version:
$Revision: 1.10 $
Author:
Yoonsik Cheon

Field Summary
protected  edu.utep.cs.jet.rat.gen.ArrayValueGenerator arrayGenerator
          Array value generator.
protected  edu.utep.cs.jet.rat.gen.InterfaceValueGenerator interfaceGenerator
          Interface value generator.
 
Constructor Summary
SimpleValueGenerator(ValueFactory factory)
          Creates a new instance to generate a value by using the given value factory.
 
Method Summary
 Denotable generate(Class<?> type, Context ctx, int maxHeight)
          Generates a new value of the given type under the given testing context.
protected  ClassValueGenerator getClassValueGenerator(Class<?> type, ValueFactory factory)
          Creates a class value generator for the given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arrayGenerator

protected edu.utep.cs.jet.rat.gen.ArrayValueGenerator arrayGenerator
Array value generator.


interfaceGenerator

protected edu.utep.cs.jet.rat.gen.InterfaceValueGenerator interfaceGenerator
Interface value generator.

Constructor Detail

SimpleValueGenerator

public SimpleValueGenerator(ValueFactory factory)
Creates a new instance to generate a value by using the given value factory.

Method Detail

generate

public Denotable generate(Class<?> type,
                          Context ctx,
                          int maxHeight)
Generates a new value of the given type under the given testing context. For a class type, maxHeight denotes the maximum height of tree representing the generated object; it is used to prevent an infinite or excessive recursion during object creation.

Specified by:
generate in interface ValueGenerator

getClassValueGenerator

protected ClassValueGenerator getClassValueGenerator(Class<?> type,
                                                     ValueFactory factory)
Creates a class value generator for the given type.


JET

JET is Copyright (C) 2005-2008 by The University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.